{"action":"created","issue":{"url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/4665","labels_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/4665/labels{/name}","comments_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/4665/comments","events_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/4665/events","html_url":"https://github.com/WhisperSystems/Signal-Android/issues/4665","id":118254996,"number":4665,"title":"Shared media draft disappears after reboot, orphaned PersistentBlobProvider file","user":{"login":"unrulygnu","id":11031903,"avatar_url":"https://avatars.githubusercontent.com/u/11031903?v=3","gravatar_id":"","url":"https://api.github.com/users/unrulygnu","html_url":"https://github.com/unrulygnu","followers_url":"https://api.github.com/users/unrulygnu/followers","following_url":"https://api.github.com/users/unrulygnu/following{/other_user}","gists_url":"https://api.github.com/users/unrulygnu/gists{/gist_id}","starred_url":"https://api.github.com/users/unrulygnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unrulygnu/subscriptions","organizations_url":"https://api.github.com/users/unrulygnu/orgs","repos_url":"https://api.github.com/users/unrulygnu/repos","events_url":"https://api.github.com/users/unrulygnu/events{/privacy}","received_events_url":"https://api.github.com/users/unrulygnu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mcginty","id":373823,"avatar_url":"https://avatars.githubusercontent.com/u/373823?v=3","gravatar_id":"","url":"https://api.github.com/users/mcginty","html_url":"https://github.com/mcginty","followers_url":"https://api.github.com/users/mcginty/followers","following_url":"https://api.github.com/users/mcginty/following{/other_user}","gists_url":"https://api.github.com/users/mcginty/gists{/gist_id}","starred_url":"https://api.github.com/users/mcginty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcginty/subscriptions","organizations_url":"https://api.github.com/users/mcginty/orgs","repos_url":"https://api.github.com/users/mcginty/repos","events_url":"https://api.github.com/users/mcginty/events{/privacy}","received_events_url":"https://api.github.com/users/mcginty/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/WhisperSystems/Signal-Android/milestones/67","html_url":"https://github.com/WhisperSystems/Signal-Android/milestones/3.6.0","labels_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/milestones/67/labels","id":1409579,"number":67,"title":"3.6.0","description":null,"creator":{"login":"riyapenn","id":4898366,"avatar_url":"https://avatars.githubusercontent.com/u/4898366?v=3","gravatar_id":"","url":"https://api.github.com/users/riyapenn","html_url":"https://github.com/riyapenn","followers_url":"https://api.github.com/users/riyapenn/followers","following_url":"https://api.github.com/users/riyapenn/following{/other_user}","gists_url":"https://api.github.com/users/riyapenn/gists{/gist_id}","starred_url":"https://api.github.com/users/riyapenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riyapenn/subscriptions","organizations_url":"https://api.github.com/users/riyapenn/orgs","repos_url":"https://api.github.com/users/riyapenn/repos","events_url":"https://api.github.com/users/riyapenn/events{/privacy}","received_events_url":"https://api.github.com/users/riyapenn/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":10,"state":"open","created_at":"2015-11-13T00:36:51Z","updated_at":"2015-11-24T04:58:25Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-11-22T10:24:22Z","updated_at":"2015-11-24T15:13:15Z","closed_at":null,"body":"While working on another issue, I found a handful of orphaned files in `app_captures`, at a time when I had no draft media messages pending. I narrowed down these steps to reproduce consistently, yet there may be other ways to reproduce the issue. \r\n\r\n**Steps to reproduce** (UPDATED)\r\n\r\n1. `adb shell ls -la /data/data/org.thoughtcrime.securesms/app_captures/` to verify contents\r\n2. Select a photo or video in Gallery/Photos\r\n3. Share the media with Signal\r\n4. Select a contact and note the time\r\n5. Observe the draft media message in the Conversation\r\n6. Tap `Back` (this saves the draft media message)\r\n7. Tap on the Conversation again\r\n8. OPTIONAL: Tap `Home` (calls `onPause()`, but not `onDestroy()`)\r\n9. `adb reboot`, install a new build, or other `Activity`-killing action that does not call `onDestroy()`\r\n10. Open Signal\r\n11. Observe the draft media message in the Conversation List\r\n12. Tap the Conversation\r\n13. Behold the disappearance of the draft media message\r\n14. `adb shell ls -la /data/data/org.thoughtcrime.securesms/app_captures/`\r\n15. Behold the orphaned, a-bit-too-persistent blob file\r\n\r\nDevice info: Nexus 5, stock Android 6.0 MRA58K, TextSecure 3.5.0 (d21fe51), 3.5.1 (6a18824)\r\n\r\nApp state: Signal registered, SMS enabled, default SMS app\r\n"},"comment":{"url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/comments/159298325","html_url":"https://github.com/WhisperSystems/Signal-Android/issues/4665#issuecomment-159298325","issue_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/4665","id":159298325,"user":{"login":"unrulygnu","id":11031903,"avatar_url":"https://avatars.githubusercontent.com/u/11031903?v=3","gravatar_id":"","url":"https://api.github.com/users/unrulygnu","html_url":"https://github.com/unrulygnu","followers_url":"https://api.github.com/users/unrulygnu/followers","following_url":"https://api.github.com/users/unrulygnu/following{/other_user}","gists_url":"https://api.github.com/users/unrulygnu/gists{/gist_id}","starred_url":"https://api.github.com/users/unrulygnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unrulygnu/subscriptions","organizations_url":"https://api.github.com/users/unrulygnu/orgs","repos_url":"https://api.github.com/users/unrulygnu/repos","events_url":"https://api.github.com/users/unrulygnu/events{/privacy}","received_events_url":"https://api.github.com/users/unrulygnu/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T15:13:15Z","updated_at":"2015-11-24T15:13:15Z","body":"@agrajaghh :\r\n> If the conversation is open and you restart the phone, will `onPause()` be called?\r\n\r\n* `adb reboot`: No\r\n\r\n        E/(): Device disconnected\r\n* Power button: Yes, but not `onDestroy()`\r\n\r\n        D/ShutdownThread: Notifying thread to start shutdown longPressBehavior=1\r\n        I/ShutdownThread: Sending shutdown broadcast...\r\n        D/ShutDownListener: ACTION_SHUTDOWN Received, waiting for oemhook readiness callback\r\n        I/ShutdownThread: Shutting down activity manager...\r\n        W/PassphraseRequiredActionBarActivity: onPause()\r\n        D/ConversationActivity: onPause()\r\n        W/KeyCachingService: onStartCommand, org.thoughtcrime.securesms.service.action.ACTIVITY_STOP_EVENT\r\n        W/KeyCachingService: Decrementing activity count...\r\n        D/ConversationActivity: onStop()\r\n* Lightning strikes, other acts of God:  I assume not :stuck_out_tongue_winking_eye: \r\n\r\nAnd for the sake of thoroughness:\r\n\r\n* Installing a new build: No\r\n\r\n        I/ActivityManager: Force stopping org.thoughtcrime.securesms appid=XXX user=-1: uninstall pkg\r\n        I/ActivityManager: Killing XXX:org.thoughtcrime.securesms/XXX (adj 0): stop org.thoughtcrime.securesms\r\n        I/WindowState: WIN DEATH: Window{XXX u0 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity}"}}