{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/10296","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/10296/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/10296/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/10296/events","html_url":"https://github.com/facebook/react-native/pull/10296","id":181805135,"number":10296,"title":"Fix the bug - App crashed when  Android permission request got interrupted ","user":{"login":"pureklkl","id":15070582,"avatar_url":"https://avatars.githubusercontent.com/u/15070582?v=3","gravatar_id":"","url":"https://api.github.com/users/pureklkl","html_url":"https://github.com/pureklkl","followers_url":"https://api.github.com/users/pureklkl/followers","following_url":"https://api.github.com/users/pureklkl/following{/other_user}","gists_url":"https://api.github.com/users/pureklkl/gists{/gist_id}","starred_url":"https://api.github.com/users/pureklkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pureklkl/subscriptions","organizations_url":"https://api.github.com/users/pureklkl/orgs","repos_url":"https://api.github.com/users/pureklkl/repos","events_url":"https://api.github.com/users/pureklkl/events{/privacy}","received_events_url":"https://api.github.com/users/pureklkl/received_events","type":"User","site_admin":false},"labels":[{"id":196858975,"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7","default":false},{"id":172167492,"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20needs-revision","name":"GH Review: needs-revision","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-08T05:06:24Z","updated_at":"2016-11-23T17:36:09Z","closed_at":"2016-11-23T17:36:09Z","pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/10296","html_url":"https://github.com/facebook/react-native/pull/10296","diff_url":"https://github.com/facebook/react-native/pull/10296.diff","patch_url":"https://github.com/facebook/react-native/pull/10296.patch"},"body":"The code to handle the request result in PermissionAndorid didn't have bound check on grand results.\n\nWhen a request process was interrupted, the result will have zero length and cause the app crash.\n\nI fixed it by returning a null for interrupted request because I don't want to change the API. But returning a Integer instead of a Boolean which was also used in Android API will be better.\n\nThe bug can be reproduced by emit two permission requests subsequently without waiting the result. The second one will interrupt the first one. App will crash on real divice (I tested it on oneplus 3, API23).\nThe bug seems won't happen on emulators.\n\nThe interrupted permission request was mentioned at [there](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback.html)\n\n> \"Note: It is possible that the permissions request interaction with the user is interrupted. In this case you will receive empty permissions and results arrays which should be treated as a cancellation.\"\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/262582227","html_url":"https://github.com/facebook/react-native/pull/10296#issuecomment-262582227","issue_url":"https://api.github.com/repos/facebook/react-native/issues/10296","id":262582227,"user":{"login":"mkonicek","id":346214,"avatar_url":"https://avatars.githubusercontent.com/u/346214?v=3","gravatar_id":"","url":"https://api.github.com/users/mkonicek","html_url":"https://github.com/mkonicek","followers_url":"https://api.github.com/users/mkonicek/followers","following_url":"https://api.github.com/users/mkonicek/following{/other_user}","gists_url":"https://api.github.com/users/mkonicek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkonicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkonicek/subscriptions","organizations_url":"https://api.github.com/users/mkonicek/orgs","repos_url":"https://api.github.com/users/mkonicek/repos","events_url":"https://api.github.com/users/mkonicek/events{/privacy}","received_events_url":"https://api.github.com/users/mkonicek/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T17:36:09Z","updated_at":"2016-11-23T17:36:09Z","body":"This pull request has been inactive for a while and the last comments are questions or there have been changes requested.\r\n\r\nI'll close the pull request so it doesn't stay open indefinitely. If you plan to continue working on this please send a new pull request."}}
{"actor":{"display_login":"mkonicek"}}