{"action":"created","issue":{"url":"https://api.github.com/repos/LIFX/LIFXKit/issues/24","labels_url":"https://api.github.com/repos/LIFX/LIFXKit/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/LIFX/LIFXKit/issues/24/comments","events_url":"https://api.github.com/repos/LIFX/LIFXKit/issues/24/events","html_url":"https://github.com/LIFX/LIFXKit/issues/24","id":70119553,"number":24,"title":"LIFX White 800 on network breaks all 3rd party apps","user":{"login":"lightbow","id":5239751,"avatar_url":"https://avatars.githubusercontent.com/u/5239751?v=3","gravatar_id":"","url":"https://api.github.com/users/lightbow","html_url":"https://github.com/lightbow","followers_url":"https://api.github.com/users/lightbow/followers","following_url":"https://api.github.com/users/lightbow/following{/other_user}","gists_url":"https://api.github.com/users/lightbow/gists{/gist_id}","starred_url":"https://api.github.com/users/lightbow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightbow/subscriptions","organizations_url":"https://api.github.com/users/lightbow/orgs","repos_url":"https://api.github.com/users/lightbow/repos","events_url":"https://api.github.com/users/lightbow/events{/privacy}","received_events_url":"https://api.github.com/users/lightbow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-22T13:04:26Z","updated_at":"2015-04-29T12:17:42Z","closed_at":"2015-04-29T06:28:34Z","body":"I have a user reporting a crash that happens every time, shortly after launch, only if a LIFX White 800 is on their network. It looks like it is happening on the main thread, and entirely within LIFXKit. My LIFX White 800 bulbs are still in transit with FedEx, so I haven't verified this yet in-person, but I hope I'm wrong and this problem isn't widespread. Posting here in case any other developers can confirm or deny reproducibility. LIFXKit is seven months old, but the main LIFX app is clearly using a newer version of this code.\r\n\r\n-[LFXMessageRateManager connect]: unrecognized selector sent to instance 0x15ed5ab0\r\n\r\nHere's the offending chunk of code:\r\n``` Objective-C\r\n\t\tLFXGatewayConnection *newConnection = [LFXGatewayConnection gatewayConnectionWithGatewayDescriptor:gateway messageRateManager:self.networkContext.messageRateManager delegate:self];\r\n\t\tself.gatewayConnections[gateway] = newConnection;\r\n\t\t[newConnection connect];\r\n```\r\nwhere newConnection isn't actually a LFXGatewayConnection, but somehow a LFXMessageRateManager. Looking at the code, that doesn't seem possible, so I wonder if it's a memory management issue and it's messaging garbage?\r\n\r\n```\r\n5   Lightbow                             0x001622c3 -[LFXLocalTransportManager gatewayDiscoveryController:didUpdateEntry:entryIsNew:] (LFXLocalTransportManager.m:351)\r\n6   Lightbow                             0x0015c68b -[LFXGatewayDiscoveryController handleStatePANGatewayMessage:] (LFXGatewayDiscoveryController.m:98)\r\n7   Lightbow                             0x0015bf6f __94+[LFXGatewayDiscoveryController gatewayDiscoveryControllerWithLocalTransportManager:delegate:]_block_invoke (LFXGatewayDiscoveryController.m:39)\r\n8   Lightbow                             0x0016f16b -[LFXTransportManager sendObserverCallbacksForMessage:] (LFXTransportManager.m:126)\r\n9   Lightbow                             0x0016201b -[LFXLocalTransportManager gatewayConnection:didReceiveMessage:fromHost:] (LFXLocalTransportManager.m:313)\r\n10  Lightbow                             0x00170a83 -[LFXUDPGatewayConnection udpSocket:didReceiveData:fromAddress:withFilterContext:] (LFXUDPGatewayConnection.m:266)\r\n11  Lightbow                             0x0014c86b __72-[GCDAsyncUdpSocket notifyDidReceiveData:fromAddress:withFilterContext:]_block_invoke (GCDAsyncUdpSocket.m:978)\r\n12  libdispatch.dylib                    0x31c052e3 _dispatch_call_block_and_release + 8\r\n13  libdispatch.dylib                    0x31c052cf _dispatch_client_callout + 20\r\n14  libdispatch.dylib                    0x31c08d2f _dispatch_main_queue_callback_4CF + 1328\r\n15  CoreFoundation                       0x230ec609 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6\r\n16  CoreFoundation                       0x230ead09 __CFRunLoopRun + 1510\r\n17  CoreFoundation                       0x23037201 CFRunLoopRunSpecific + 474\r\n18  CoreFoundation                       0x23037013 CFRunLoopRunInMode + 104\r\n19  GraphicsServices                     0x2a8d0201 GSEventRunModal + 134\r\n20  UIKit                                0x267dba59 UIApplicationMain + 1438\r\n21  Lightbow                             0x001fc46b main (main.m:16)\r\n22  libdyld.dylib                        0x31c26aaf start + 0\r\n```"},"comment":{"url":"https://api.github.com/repos/LIFX/LIFXKit/issues/comments/97404646","html_url":"https://github.com/LIFX/LIFXKit/issues/24#issuecomment-97404646","issue_url":"https://api.github.com/repos/LIFX/LIFXKit/issues/24","id":97404646,"user":{"login":"chendo","id":2661,"avatar_url":"https://avatars.githubusercontent.com/u/2661?v=3","gravatar_id":"","url":"https://api.github.com/users/chendo","html_url":"https://github.com/chendo","followers_url":"https://api.github.com/users/chendo/followers","following_url":"https://api.github.com/users/chendo/following{/other_user}","gists_url":"https://api.github.com/users/chendo/gists{/gist_id}","starred_url":"https://api.github.com/users/chendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chendo/subscriptions","organizations_url":"https://api.github.com/users/chendo/orgs","repos_url":"https://api.github.com/users/chendo/repos","events_url":"https://api.github.com/users/chendo/events{/privacy}","received_events_url":"https://api.github.com/users/chendo/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T12:17:42Z","updated_at":"2015-04-29T12:17:42Z","body":"That's why I also added a check for nil and returning before putting it in\nthe dictionary.\n\nOn Wednesday, April 29, 2015, Lightbow <notifications@github.com> wrote:\n\n> @chendo <https://github.com/chendo> I don't think you should just return\n> nil in that case, because then the very next line in\n> LFXLocalTransportManager would crash when it tries to stuff nil object into\n> an NSDictionary.\n>\n>         LFXGatewayConnection *newConnection = [LFXGatewayConnection gatewayConnectionWithGatewayDescriptor:gateway messageRateManager:self.networkContext.messageRateManager delegate:self];\n>         self.gatewayConnections[gateway] = newConnection;\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/LIFX/LIFXKit/issues/24#issuecomment-97401188>.\n>\n"}}