{"action":"created","issue":{"url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/238","labels_url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/238/comments","events_url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/238/events","html_url":"https://github.com/smartdevicelink/sdl_ios/issues/238","id":89568294,"number":238,"title":"StartSession Request Timeout Occurs Every Time After Unplugging/Reconnecting A Phone","user":{"login":"adein","id":1576508,"avatar_url":"https://avatars.githubusercontent.com/u/1576508?v=3","gravatar_id":"","url":"https://api.github.com/users/adein","html_url":"https://github.com/adein","followers_url":"https://api.github.com/users/adein/followers","following_url":"https://api.github.com/users/adein/following{/other_user}","gists_url":"https://api.github.com/users/adein/gists{/gist_id}","starred_url":"https://api.github.com/users/adein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adein/subscriptions","organizations_url":"https://api.github.com/users/adein/orgs","repos_url":"https://api.github.com/users/adein/repos","events_url":"https://api.github.com/users/adein/events{/privacy}","received_events_url":"https://api.github.com/users/adein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/smartdevicelink/sdl_ios/labels/bug","name":"bug","color":"F44336"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-19T13:45:45Z","updated_at":"2015-06-19T13:51:12Z","closed_at":null,"body":"#### Environment:\r\n* iOS 8.3\r\n* \"Connected Vehicle\" app\r\n* SYNC3 TDK\r\n\r\n#### Reproduction Steps:\r\n1. Start the app on the phone, then connect to the TDK\r\n2. Wait for the app to register with SYNC, then unplug the phone\r\n3. Plug the phone back in\r\n\r\n#### Expected Results:\r\nApp re-registers with Sync\r\n\r\n#### Actual Results:\r\nThe SDL proxy connects to the Control Session, obtains a new protocol index, and closes that session.  Then it starts a Data Session on the new protocol index, but does not receive a response to the StartSession request.\r\n\r\n#### Recovery:\r\nTerminate the app (swipe it out of the recent apps tray) and re-launch it.\r\n\r\n#### Notes:\r\n\r\nBased on viewing iAP traces, it does appear as if the headunit (SYNC3) is sending the response, but the proxy doesn't receive / process it somehow.\r\n\r\nLog snippet:\r\n```\r\n06/19/15 08:57:45.261: [1] Accessory Connected, Opening in 7.883s\r\n06/19/15 08:57:49.382: [3] SDLIAPTransport Dealloc\r\n06/19/15 08:57:53.150: [1] Attempting To Connect\r\n06/19/15 08:57:53.156: [1] Starting MultiApp Session\r\n06/19/15 08:57:53.160: [1] SDLIAPSession initWithAccessory:<EAAccessory: 0x1700140a0> forProtocol:com.smartdevicelink.prot0\r\n06/19/15 08:57:53.165: [1] Opening EASession withAccessory:Infotainment System forProtocol:com.smartdevicelink.prot0\r\n06/19/15 08:57:53.172: [1] Created Session Object\r\n06/19/15 08:57:53.179: [1] Input Stream Opened\r\n06/19/15 08:57:53.185: [1] Output Stream Opened\r\n06/19/15 08:57:53.186: [5] Control Stream Received Data\r\n06/19/15 08:57:53.190: [1] Control Session Established\r\n06/19/15 08:57:53.199: [5] Switching to protocol 1\r\n06/19/15 08:57:53.204: [5] Output Stream Closed\r\n06/19/15 08:57:53.209: [5] Input Stream Closed\r\n06/19/15 08:57:53.230: [5] SDLIAPSession Dealloc\r\n06/19/15 08:57:53.299: [1] Starting Data Session\r\n06/19/15 08:57:53.305: [1] SDLIAPSession initWithAccessory:<EAAccessory: 0x1700140a0> forProtocol:com.smartdevicelink.prot1\r\n06/19/15 08:57:53.311: [1] Opening EASession withAccessory:Infotainment System forProtocol:com.smartdevicelink.prot1\r\n06/19/15 08:57:53.319: [1] Created Session Object\r\n06/19/15 08:57:53.328: [1] Output Stream Opened\r\n06/19/15 08:57:53.333: [1] Input Stream Opened\r\n06/19/15 08:57:53.338: [1] Data Session Established\r\n06/19/15 08:57:53.343: [1] StartSession (request)\r\n06/19/15 08:57:53.347: [1] Warning: Tried to retrieve sessionID for serviceType 7, but no sessionID is saved for that service type.\r\n06/19/15 08:58:03.352: [1] Start Session Timeout\r\n06/19/15 08:58:03.468: [10] onProxyClosed\r\n06/19/15 08:58:03.479: [10] Stop Proxy\r\n06/19/15 08:58:03.484: [10] IAP Disconnecting\r\n06/19/15 08:58:03.488: [10] Output Stream Closed\r\n06/19/15 08:58:03.493: [10] Input Stream Closed\r\n06/19/15 08:58:03.535: [10] SDLIAPSession Dealloc\r\n06/19/15 08:58:03.554: [10] SDLIAPTransport Stopped Listening For Events\r\n06/19/15 08:58:03.570: [10] SDLProtocol Dealloc\r\n06/19/15 08:58:03.575: [10] SDLProxy Dealloc\r\n06/19/15 08:58:03.612: [5] Start Proxy\r\n06/19/15 08:58:03.617: [5] SDLIAPTransport Listening For Events\r\n06/19/15 08:58:03.625: [5] SDLIAPTransport Init\r\n06/19/15 08:58:03.630: [5] SDLProxy initWithTransport\r\n```"},"comment":{"url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/comments/113520159","html_url":"https://github.com/smartdevicelink/sdl_ios/issues/238#issuecomment-113520159","issue_url":"https://api.github.com/repos/smartdevicelink/sdl_ios/issues/238","id":113520159,"user":{"login":"adein","id":1576508,"avatar_url":"https://avatars.githubusercontent.com/u/1576508?v=3","gravatar_id":"","url":"https://api.github.com/users/adein","html_url":"https://github.com/adein","followers_url":"https://api.github.com/users/adein/followers","following_url":"https://api.github.com/users/adein/following{/other_user}","gists_url":"https://api.github.com/users/adein/gists{/gist_id}","starred_url":"https://api.github.com/users/adein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adein/subscriptions","organizations_url":"https://api.github.com/users/adein/orgs","repos_url":"https://api.github.com/users/adein/repos","events_url":"https://api.github.com/users/adein/events{/privacy}","received_events_url":"https://api.github.com/users/adein/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T13:51:12Z","updated_at":"2015-06-19T13:51:12Z","body":"Relevant log snippet from when the Data Session actually gets established:\r\n```\r\n06/19/15 08:57:35.563: [1] Opening EASession withAccessory:Infotainment System forProtocol:com.smartdevicelink.prot1\r\n06/19/15 08:57:35.571: [1] Created Session Object\r\n06/19/15 08:57:35.580: [1] Output Stream Opened\r\n06/19/15 08:57:35.585: [1] Input Stream Opened\r\n06/19/15 08:57:35.590: [1] Data Session Established\r\n06/19/15 08:57:35.594: [1] StartSession (request)\r\n06/19/15 08:57:35.598: [1] Warning: Tried to retrieve sessionID for serviceType 7, but no sessionID is saved for that service type.\r\n06/19/15 08:57:35.671: [6] message complete. Version:2, compressed:0, frameType:Control(0), serviceType:7, frameData:StartSessionACK(2), sessionID:1, dataSize:4, messageID:16  Payload: 4 bytes.\r\n06/19/15 08:57:35.675: [6] StartSession (response)\r\nSessionId: 1 for serviceType 7\r\n06/19/15 08:57:35.684: [6] onProxyOpened\r\n```"}}