{"action":"created","issue":{"url":"https://api.github.com/repos/novoda/merlin/issues/171","repository_url":"https://api.github.com/repos/novoda/merlin","labels_url":"https://api.github.com/repos/novoda/merlin/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/novoda/merlin/issues/171/comments","events_url":"https://api.github.com/repos/novoda/merlin/issues/171/events","html_url":"https://github.com/novoda/merlin/issues/171","id":365830130,"node_id":"MDU6SXNzdWUzNjU4MzAxMzA=","number":171,"title":"IllegalStateException - You must call canNotify() before calling notify(ConnectivityChangeEvent)","user":{"login":"ouchadam","id":1848238,"node_id":"MDQ6VXNlcjE4NDgyMzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1848238?v=4","gravatar_id":"","url":"https://api.github.com/users/ouchadam","html_url":"https://github.com/ouchadam","followers_url":"https://api.github.com/users/ouchadam/followers","following_url":"https://api.github.com/users/ouchadam/following{/other_user}","gists_url":"https://api.github.com/users/ouchadam/gists{/gist_id}","starred_url":"https://api.github.com/users/ouchadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouchadam/subscriptions","organizations_url":"https://api.github.com/users/ouchadam/orgs","repos_url":"https://api.github.com/users/ouchadam/repos","events_url":"https://api.github.com/users/ouchadam/events{/privacy}","received_events_url":"https://api.github.com/users/ouchadam/received_events","type":"User","site_admin":false},"labels":[{"id":592219514,"node_id":"MDU6TGFiZWw1OTIyMTk1MTQ=","url":"https://api.github.com/repos/novoda/merlin/labels/bug","name":"bug","color":"CD0000","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-02T10:14:00Z","updated_at":"2018-10-12T01:06:48Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"#### Problem\r\n\r\n\r\nHave seen a single crash in `crashlytics` with\r\n\r\n```\r\n\r\nIllegalStateException - You must call canNotify() before calling notify(ConnectivityChangeEvent)\r\n\r\ncom.novoda.merlin.service.MerlinService$LocalBinder.notify (SourceFile:81)\r\ncom.novoda.merlin.receiver.ConnectivityCallbacks.notifyMerlinService (SourceFile:45)\r\ncom.novoda.merlin.receiver.ConnectivityCallbacks.onAvailable (SourceFile:26)\r\nandroid.net.ConnectivityManager$CallbackHandler.handleMessage (ConnectivityManager.java:2807)\r\nandroid.os.Handler.dispatchMessage (Handler.java:105)\r\nandroid.os.Looper.loop (Looper.java:164)\r\nandroid.os.HandlerThread.run (HandlerThread.java:65)\r\n```\r\n\r\nThis _should_ be impossible since the [call to `notify`](https://github.com/novoda/merlin/blob/master/core/src/main/java/com/novoda/merlin/ConnectivityCallbacks.java#L35) is guarded with a `canNotify` however, it appears this was running on a background `HandlerThread` meaning it's possible the service became unbound during act of notifying  \r\n\r\n#### Potential Solution\r\n\r\nTo force interactions with the service to be via the `main thread` to ensure the guard and notification are always serial  \r\n\r\n#### Impact\r\n\r\n- Is a client side uncatchable (without uncaught exception handlers) runtime crash\r\n"},"comment":{"url":"https://api.github.com/repos/novoda/merlin/issues/comments/429170514","html_url":"https://github.com/novoda/merlin/issues/171#issuecomment-429170514","issue_url":"https://api.github.com/repos/novoda/merlin/issues/171","id":429170514,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTE3MDUxNA==","user":{"login":"ericpearson","id":793594,"node_id":"MDQ6VXNlcjc5MzU5NA==","avatar_url":"https://avatars1.githubusercontent.com/u/793594?v=4","gravatar_id":"","url":"https://api.github.com/users/ericpearson","html_url":"https://github.com/ericpearson","followers_url":"https://api.github.com/users/ericpearson/followers","following_url":"https://api.github.com/users/ericpearson/following{/other_user}","gists_url":"https://api.github.com/users/ericpearson/gists{/gist_id}","starred_url":"https://api.github.com/users/ericpearson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericpearson/subscriptions","organizations_url":"https://api.github.com/users/ericpearson/orgs","repos_url":"https://api.github.com/users/ericpearson/repos","events_url":"https://api.github.com/users/ericpearson/events{/privacy}","received_events_url":"https://api.github.com/users/ericpearson/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T01:06:48Z","updated_at":"2018-10-12T01:06:48Z","author_association":"NONE","body":"I have seen this bug a lot in our app as well. Would be nice to see a fix."}}
{"actor":{"display_login":"ericpearson"}}