{"action":"created","comment":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/comments/34443897","id":34443897,"diff_hunk":"@@ -13,6 +13,10 @@\n final class DownloadStatus {\n \n     /**\n+     * This download has been marked for deletion and it will be deleted in the future\n+     */\n+    public static final int DELETING = 188;","path":"library/src/main/java/com/novoda/downloadmanager/lib/DownloadStatus.java","position":6,"original_position":6,"commit_id":"04f887eed5d66bf4c5931e521ae745e53e5fa624","original_commit_id":"dda6500a44709baddd30f43851a0df00f29a4bf7","user":{"login":"amlcurran","id":666285,"avatar_url":"https://avatars.githubusercontent.com/u/666285?v=3","gravatar_id":"","url":"https://api.github.com/users/amlcurran","html_url":"https://github.com/amlcurran","followers_url":"https://api.github.com/users/amlcurran/followers","following_url":"https://api.github.com/users/amlcurran/following{/other_user}","gists_url":"https://api.github.com/users/amlcurran/gists{/gist_id}","starred_url":"https://api.github.com/users/amlcurran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amlcurran/subscriptions","organizations_url":"https://api.github.com/users/amlcurran/orgs","repos_url":"https://api.github.com/users/amlcurran/repos","events_url":"https://api.github.com/users/amlcurran/events{/privacy}","received_events_url":"https://api.github.com/users/amlcurran/received_events","type":"User","site_admin":false},"body":"yeah but status codes between 400 and 500 count as an error - just wondering if this is an error but probably not","created_at":"2015-07-13T08:54:54Z","updated_at":"2015-07-13T08:54:54Z","html_url":"https://github.com/novoda/download-manager/pull/94#discussion_r34443897","pull_request_url":"https://api.github.com/repos/novoda/download-manager/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/comments/34443897"},"html":{"href":"https://github.com/novoda/download-manager/pull/94#discussion_r34443897"},"pull_request":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/94","id":39692693,"html_url":"https://github.com/novoda/download-manager/pull/94","diff_url":"https://github.com/novoda/download-manager/pull/94.diff","patch_url":"https://github.com/novoda/download-manager/pull/94.patch","issue_url":"https://api.github.com/repos/novoda/download-manager/issues/94","number":94,"state":"open","locked":false,"title":"Add deleting status","user":{"login":"zegnus","id":2845931,"avatar_url":"https://avatars.githubusercontent.com/u/2845931?v=3","gravatar_id":"","url":"https://api.github.com/users/zegnus","html_url":"https://github.com/zegnus","followers_url":"https://api.github.com/users/zegnus/followers","following_url":"https://api.github.com/users/zegnus/following{/other_user}","gists_url":"https://api.github.com/users/zegnus/gists{/gist_id}","starred_url":"https://api.github.com/users/zegnus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zegnus/subscriptions","organizations_url":"https://api.github.com/users/zegnus/orgs","repos_url":"https://api.github.com/users/zegnus/repos","events_url":"https://api.github.com/users/zegnus/events{/privacy}","received_events_url":"https://api.github.com/users/zegnus/received_events","type":"User","site_admin":false},"body":"## Feature needed ##\r\n\r\nWe need to bubble up immediately when a batch is marked for deletion.\r\n\r\nThe current implementation marks a flag in a table that doesn't affect the current status of a downloads\r\n\r\n## Solution implemented ##\r\n\r\nAs soon as a batch is marked for deletion, the batch status immediately changes to a new status `deleting`. This status happens in the same table that any other statuses and so all listeners monitoring the status of a download will be immediately notified.\r\n\r\nPrevious | Now\r\n--- | ---\r\n![after](https://cloud.githubusercontent.com/assets/2845931/8621127/cfe7d044-271b-11e5-8f18-f492f9f27d76.gif) | ![after-new](https://cloud.githubusercontent.com/assets/2845931/8621132/d4f5e10c-271b-11e5-9e54-1052df1b82dc.gif)\r\n\r\nNotice that the demo `DeleteActivity` has changed the way that listens for updates in the database. The previous implementation failed to refresh a second event if that one is faster than the `lastQueryTimestamp`, here's an example of the previous implementation (the gif old has this fixed in order to show updates):\r\n\r\n![after](https://cloud.githubusercontent.com/assets/2845931/8621406/3fbcf0d8-271d-11e5-9afd-caf384abb75d.gif)\r\n","created_at":"2015-07-10T15:03:55Z","updated_at":"2015-07-13T08:54:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc525ab05022bc4f2999862f287c64d453c72375","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/novoda/download-manager/pulls/94/commits","review_comments_url":"https://api.github.com/repos/novoda/download-manager/pulls/94/comments","review_comment_url":"https://api.github.com/repos/novoda/download-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/novoda/download-manager/issues/94/comments","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/04f887eed5d66bf4c5931e521ae745e53e5fa624","head":{"label":"novoda:Add-deleting-status","ref":"Add-deleting-status","sha":"04f887eed5d66bf4c5931e521ae745e53e5fa624","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":35211795,"name":"download-manager","full_name":"novoda/download-manager","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/download-manager","description":"Download manager based on AOSP DM but allowing downloading to internal private storage","fork":false,"url":"https://api.github.com/repos/novoda/download-manager","forks_url":"https://api.github.com/repos/novoda/download-manager/forks","keys_url":"https://api.github.com/repos/novoda/download-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/download-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/download-manager/teams","hooks_url":"https://api.github.com/repos/novoda/download-manager/hooks","issue_events_url":"https://api.github.com/repos/novoda/download-manager/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/download-manager/events","assignees_url":"https://api.github.com/repos/novoda/download-manager/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/download-manager/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/download-manager/tags","blobs_url":"https://api.github.com/repos/novoda/download-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/download-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/download-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/download-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/download-manager/languages","stargazers_url":"https://api.github.com/repos/novoda/download-manager/stargazers","contributors_url":"https://api.github.com/repos/novoda/download-manager/contributors","subscribers_url":"https://api.github.com/repos/novoda/download-manager/subscribers","subscription_url":"https://api.github.com/repos/novoda/download-manager/subscription","commits_url":"https://api.github.com/repos/novoda/download-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/download-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/download-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/download-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/download-manager/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/download-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/download-manager/merges","archive_url":"https://api.github.com/repos/novoda/download-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/download-manager/downloads","issues_url":"https://api.github.com/repos/novoda/download-manager/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/download-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/download-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/download-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/download-manager/labels{/name}","releases_url":"https://api.github.com/repos/novoda/download-manager/releases{/id}","created_at":"2015-05-07T09:41:52Z","updated_at":"2015-07-09T19:32:16Z","pushed_at":"2015-07-13T08:36:40Z","git_url":"git://github.com/novoda/download-manager.git","ssh_url":"git@github.com:novoda/download-manager.git","clone_url":"https://github.com/novoda/download-manager.git","svn_url":"https://github.com/novoda/download-manager","homepage":"","size":3762,"stargazers_count":51,"watchers_count":51,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":17,"forks":4,"open_issues":17,"watchers":51,"default_branch":"master"}},"base":{"label":"novoda:master","ref":"master","sha":"64bccbd825176bcc3589531e868dd0ce186a88d0","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":35211795,"name":"download-manager","full_name":"novoda/download-manager","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/download-manager","description":"Download manager based on AOSP DM but allowing downloading to internal private storage","fork":false,"url":"https://api.github.com/repos/novoda/download-manager","forks_url":"https://api.github.com/repos/novoda/download-manager/forks","keys_url":"https://api.github.com/repos/novoda/download-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/download-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/download-manager/teams","hooks_url":"https://api.github.com/repos/novoda/download-manager/hooks","issue_events_url":"https://api.github.com/repos/novoda/download-manager/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/download-manager/events","assignees_url":"https://api.github.com/repos/novoda/download-manager/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/download-manager/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/download-manager/tags","blobs_url":"https://api.github.com/repos/novoda/download-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/download-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/download-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/download-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/download-manager/languages","stargazers_url":"https://api.github.com/repos/novoda/download-manager/stargazers","contributors_url":"https://api.github.com/repos/novoda/download-manager/contributors","subscribers_url":"https://api.github.com/repos/novoda/download-manager/subscribers","subscription_url":"https://api.github.com/repos/novoda/download-manager/subscription","commits_url":"https://api.github.com/repos/novoda/download-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/download-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/download-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/download-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/download-manager/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/download-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/download-manager/merges","archive_url":"https://api.github.com/repos/novoda/download-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/download-manager/downloads","issues_url":"https://api.github.com/repos/novoda/download-manager/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/download-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/download-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/download-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/download-manager/labels{/name}","releases_url":"https://api.github.com/repos/novoda/download-manager/releases{/id}","created_at":"2015-05-07T09:41:52Z","updated_at":"2015-07-09T19:32:16Z","pushed_at":"2015-07-13T08:36:40Z","git_url":"git://github.com/novoda/download-manager.git","ssh_url":"git@github.com:novoda/download-manager.git","clone_url":"https://github.com/novoda/download-manager.git","svn_url":"https://github.com/novoda/download-manager","homepage":"","size":3762,"stargazers_count":51,"watchers_count":51,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":17,"forks":4,"open_issues":17,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/94"},"html":{"href":"https://github.com/novoda/download-manager/pull/94"},"issue":{"href":"https://api.github.com/repos/novoda/download-manager/issues/94"},"comments":{"href":"https://api.github.com/repos/novoda/download-manager/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/novoda/download-manager/statuses/04f887eed5d66bf4c5931e521ae745e53e5fa624"}}}}