{"action":"created","issue":{"url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/1113","repository_url":"https://api.github.com/repos/smartdevicelink/sdl_core","labels_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/1113/labels{/name}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/1113/comments","events_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/1113/events","html_url":"https://github.com/smartdevicelink/sdl_core/issues/1113","id":195960024,"number":1113,"title":"SDL core sending onAppUnregistered to HMI when first appregistered with SDL core","user":{"login":"madhuy","id":17032887,"avatar_url":"https://avatars.githubusercontent.com/u/17032887?v=3","gravatar_id":"","url":"https://api.github.com/users/madhuy","html_url":"https://github.com/madhuy","followers_url":"https://api.github.com/users/madhuy/followers","following_url":"https://api.github.com/users/madhuy/following{/other_user}","gists_url":"https://api.github.com/users/madhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/madhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhuy/subscriptions","organizations_url":"https://api.github.com/users/madhuy/orgs","repos_url":"https://api.github.com/users/madhuy/repos","events_url":"https://api.github.com/users/madhuy/events{/privacy}","received_events_url":"https://api.github.com/users/madhuy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jacobkeeler","id":10549248,"avatar_url":"https://avatars.githubusercontent.com/u/10549248?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobkeeler","html_url":"https://github.com/jacobkeeler","followers_url":"https://api.github.com/users/jacobkeeler/followers","following_url":"https://api.github.com/users/jacobkeeler/following{/other_user}","gists_url":"https://api.github.com/users/jacobkeeler/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobkeeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobkeeler/subscriptions","organizations_url":"https://api.github.com/users/jacobkeeler/orgs","repos_url":"https://api.github.com/users/jacobkeeler/repos","events_url":"https://api.github.com/users/jacobkeeler/events{/privacy}","received_events_url":"https://api.github.com/users/jacobkeeler/received_events","type":"User","site_admin":false},"assignees":[{"login":"jacobkeeler","id":10549248,"avatar_url":"https://avatars.githubusercontent.com/u/10549248?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobkeeler","html_url":"https://github.com/jacobkeeler","followers_url":"https://api.github.com/users/jacobkeeler/followers","following_url":"https://api.github.com/users/jacobkeeler/following{/other_user}","gists_url":"https://api.github.com/users/jacobkeeler/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobkeeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobkeeler/subscriptions","organizations_url":"https://api.github.com/users/jacobkeeler/orgs","repos_url":"https://api.github.com/users/jacobkeeler/repos","events_url":"https://api.github.com/users/jacobkeeler/events{/privacy}","received_events_url":"https://api.github.com/users/jacobkeeler/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-12-16T01:29:12Z","updated_at":"2016-12-22T16:41:06Z","closed_at":null,"body":"[SmartDeviceLinkCore_onAppUnregistered.txt](https://github.com/smartdevicelink/sdl_core/files/656196/SmartDeviceLinkCore_onAppUnregistered.txt)\r\n\r\nBased on the logs it happens only for the first app which register after starting SDL core\r\n`INFO  [15 Dec 2016 18:45:20,847][ApplicationManager] Unregistering application with app_id 65537 because of HMI language(s) mismatch.`\r\nafter onApregistererd\r\n1. it calls [CheckApplication](https://github.com/smartdevicelink/sdl_core/blob/aff7f09a4ec07becfb64dc78992580061d3342ff/src/components/application_manager/src/hmi_language_handler.cc#L138)\r\n2. this value is_need_handle_wrong_language become true and calls HandleWrongLanguageApp() method. \r\n\r\nI am not sure is it because of timing or some thing else."},"comment":{"url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/comments/268838724","html_url":"https://github.com/smartdevicelink/sdl_core/issues/1113#issuecomment-268838724","issue_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/1113","id":268838724,"user":{"login":"jacobkeeler","id":10549248,"avatar_url":"https://avatars.githubusercontent.com/u/10549248?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobkeeler","html_url":"https://github.com/jacobkeeler","followers_url":"https://api.github.com/users/jacobkeeler/followers","following_url":"https://api.github.com/users/jacobkeeler/following{/other_user}","gists_url":"https://api.github.com/users/jacobkeeler/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobkeeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobkeeler/subscriptions","organizations_url":"https://api.github.com/users/jacobkeeler/orgs","repos_url":"https://api.github.com/users/jacobkeeler/repos","events_url":"https://api.github.com/users/jacobkeeler/events{/privacy}","received_events_url":"https://api.github.com/users/jacobkeeler/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T16:41:06Z","updated_at":"2016-12-22T16:41:06Z","body":"@madhuy This isn't the result of receiving two RegisterAppInterface messages, but instead caused by firing two OnAppRegistered events (both as a result of messages sent FROM Core). \r\n\r\nThe obvious place where this would be fired is in the OnAppRegistered class ([and it is](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc#L50)), but it is also fired from the [OnApplicationRegistered function](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/application_manager/src/application_manager_impl.cc#L338) in the ApplicationManager, and this function is called when sending out a [RegisterAppInterface response](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc#L50).\r\n\r\nIt seems that this redundant event is what is causing this issue, so removing [this block](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/application_manager/src/application_manager_impl.cc#L338-L347) may fix your issue.\r\n\r\nIt appears that the reason it doesn't happen on my machine is that the appID parameter seems to be missing from one of the events:\r\n```\r\nERROR [22 Dec 2016 10:58:39,446][0x7f70627fc700][ApplicationManager] /home/jacobkeeler/Documents/sdl_core/src/components/application_manager/src/hmi_language_handler.cc:135 HMILanguageHandler::on_event: Message doesn't contain parameter app_id\r\n```\r\nThis means that Core is not calling CheckApplication a second time. \r\n\r\nI do not know yet why it isn't able to find the appID parameter on my end (it appears in the OnAppRegistered message), but that is another issue (possibly with the SDL HMI)."}}
{"actor":{"display_login":"jacobkeeler"}}