{"action":"created","issue":{"url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/42","repository_url":"https://api.github.com/repos/tbruyelle/RxPermissions","labels_url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/42/comments","events_url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/42/events","html_url":"https://github.com/tbruyelle/RxPermissions/issues/42","id":144014177,"number":42,"title":"Result is lost after Denying (DNKA on)","user":{"login":"artesa","id":15946969,"avatar_url":"https://avatars.githubusercontent.com/u/15946969?v=3","gravatar_id":"","url":"https://api.github.com/users/artesa","html_url":"https://github.com/artesa","followers_url":"https://api.github.com/users/artesa/followers","following_url":"https://api.github.com/users/artesa/following{/other_user}","gists_url":"https://api.github.com/users/artesa/gists{/gist_id}","starred_url":"https://api.github.com/users/artesa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artesa/subscriptions","organizations_url":"https://api.github.com/users/artesa/orgs","repos_url":"https://api.github.com/users/artesa/repos","events_url":"https://api.github.com/users/artesa/events{/privacy}","received_events_url":"https://api.github.com/users/artesa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-28T16:07:33Z","updated_at":"2016-03-28T16:23:16Z","closed_at":null,"body":"Hello,\r\n\r\nLooks like there is one more issue, when the result of permission request is lost. Steps to reproduce it with the sample app:\r\n\r\n1. Turn \"Do not keep activities\" on.\r\n2. Open the sample app, press \"Enable camera\".\r\n3. See the permission request dialog, don't press anything.\r\n4. Fold the app up.\r\n5. Retrieve the app from the recent apps.\r\n6. Click \"Deny\" (don't check \"Never ask again\").\r\n7. Press \"Enable camera\" again.\r\nExpected result: Permission request is done again, system dialog shown.\r\nActual result: Nothing happens.\r\n\r\nThis one did I not observe in the 0.5.x version."},"comment":{"url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/comments/202470334","html_url":"https://github.com/tbruyelle/RxPermissions/issues/42#issuecomment-202470334","issue_url":"https://api.github.com/repos/tbruyelle/RxPermissions/issues/42","id":202470334,"user":{"login":"artesa","id":15946969,"avatar_url":"https://avatars.githubusercontent.com/u/15946969?v=3","gravatar_id":"","url":"https://api.github.com/users/artesa","html_url":"https://github.com/artesa","followers_url":"https://api.github.com/users/artesa/followers","following_url":"https://api.github.com/users/artesa/following{/other_user}","gists_url":"https://api.github.com/users/artesa/gists{/gist_id}","starred_url":"https://api.github.com/users/artesa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artesa/subscriptions","organizations_url":"https://api.github.com/users/artesa/orgs","repos_url":"https://api.github.com/users/artesa/repos","events_url":"https://api.github.com/users/artesa/events{/privacy}","received_events_url":"https://api.github.com/users/artesa/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T16:23:16Z","updated_at":"2016-03-28T16:23:16Z","body":"Looks like problem has appeared due to some changes in the null publish subjects handling. When I changed the part of request_() method (lines 193-205) to the following, the bug stopped to appear:\r\n\r\n```\r\nPublishSubject<Permission> subject = mSubjects.get(permission);\r\n            // Request the permission to the framework only if not already done\r\n            // and if there's no request without result (occurs on configuration\r\n            // change, see onDestroy method).\r\n            if (subject == null) {    // sic!\r\n                unrequestedPermissions.add(permission);\r\n            }\r\n\r\n            // Create a new subject if not exists\r\n            if (subject == null || subject.hasCompleted()) {    // sic!\r\n                subject = PublishSubject.create();\r\n                mSubjects.put(permission, subject);\r\n            }\r\n```\r\n\r\nThis is actually how it was in one of the previous versions (to be precise, before the commit e205f9dd5669073731b2deed293fcc02ecee69d3). I'm not sure, however, if such a change would now have any side-effects.\r\n\r\nMaybe it would be helpful."}}