{"action":"closed","number":375,"pull_request":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/375","id":176536005,"html_url":"https://github.com/novoda/download-manager/pull/375","diff_url":"https://github.com/novoda/download-manager/pull/375.diff","patch_url":"https://github.com/novoda/download-manager/pull/375.patch","issue_url":"https://api.github.com/repos/novoda/download-manager/issues/375","number":375,"state":"closed","locked":false,"title":"Awaiting network file size incorrect","user":{"login":"Mecharyry","id":3380092,"avatar_url":"https://avatars1.githubusercontent.com/u/3380092?v=4","gravatar_id":"","url":"https://api.github.com/users/Mecharyry","html_url":"https://github.com/Mecharyry","followers_url":"https://api.github.com/users/Mecharyry/followers","following_url":"https://api.github.com/users/Mecharyry/following{/other_user}","gists_url":"https://api.github.com/users/Mecharyry/gists{/gist_id}","starred_url":"https://api.github.com/users/Mecharyry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mecharyry/subscriptions","organizations_url":"https://api.github.com/users/Mecharyry/orgs","repos_url":"https://api.github.com/users/Mecharyry/repos","events_url":"https://api.github.com/users/Mecharyry/events{/privacy}","received_events_url":"https://api.github.com/users/Mecharyry/received_events","type":"User","site_admin":false},"body":"## Problem\r\n- After queuing a download and forcing the await network path, when retrieving the `DownloadFileStatus` it will be incorrect. The `DownloadFileStatus` will return `0` even after triggering the download. This happens because we never remove the batch from the `DownloadManager` map when awaiting network, so it always has the incorrect size 😬 \r\n\r\n- Turns out that it is impossible to delete a download that is awaiting network 😬 The files are marked as deleted but the batch is not. Ordinarily for `Downloading` we tell the downloader to stop, which will then check the status and force the batch to be updated. In the scenario for `DOWNLOADED` and `PAUSED` batches we check during the `delete` method call and update the batch, we need to do the same for `WAITING_FOR_NETWORK`. \r\n\r\n## Solution\r\n- Update the map whenever we trigger a `submitAllStoredDownloads`. \r\n\r\n- Add `WAITING_FOR_NETWORK` to the delete statements that update the batch.","created_at":"2018-03-21T16:31:43Z","updated_at":"2018-03-22T11:02:20Z","closed_at":"2018-03-22T11:02:20Z","merged_at":"2018-03-22T11:02:20Z","merge_commit_sha":"076c3b89beff4cf5cbe01a90cefd57d5204eb3c9","assignee":{"login":"zegnus","id":2845931,"avatar_url":"https://avatars3.githubusercontent.com/u/2845931?v=4","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},"assignees":[{"login":"zegnus","id":2845931,"avatar_url":"https://avatars3.githubusercontent.com/u/2845931?v=4","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}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":576993037,"url":"https://api.github.com/repos/novoda/download-manager/labels/v2","name":"v2","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/novoda/download-manager/pulls/375/commits","review_comments_url":"https://api.github.com/repos/novoda/download-manager/pulls/375/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/375/comments","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/e59a35e5a3eb798e045db5f97b35f52385c390bf","head":{"label":"novoda:airplane_mode_download","ref":"airplane_mode_download","sha":"e59a35e5a3eb798e045db5f97b35f52385c390bf","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars2.githubusercontent.com/u/74874?v=4","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://avatars2.githubusercontent.com/u/74874?v=4","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}","deployments_url":"https://api.github.com/repos/novoda/download-manager/deployments","created_at":"2015-05-07T09:41:52Z","updated_at":"2018-03-12T16:28:38Z","pushed_at":"2018-03-22T11:02:20Z","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":239591,"stargazers_count":133,"watchers_count":133,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":30,"open_issues":53,"watchers":133,"default_branch":"master"}},"base":{"label":"novoda:epic_download_manager_v2","ref":"epic_download_manager_v2","sha":"e9e676a63f2564d19aa38fbb3e641d864743e057","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars2.githubusercontent.com/u/74874?v=4","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://avatars2.githubusercontent.com/u/74874?v=4","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}","deployments_url":"https://api.github.com/repos/novoda/download-manager/deployments","created_at":"2015-05-07T09:41:52Z","updated_at":"2018-03-12T16:28:38Z","pushed_at":"2018-03-22T11:02:20Z","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":239591,"stargazers_count":133,"watchers_count":133,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":30,"open_issues":53,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/375"},"html":{"href":"https://github.com/novoda/download-manager/pull/375"},"issue":{"href":"https://api.github.com/repos/novoda/download-manager/issues/375"},"comments":{"href":"https://api.github.com/repos/novoda/download-manager/issues/375/comments"},"review_comments":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/375/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/375/commits"},"statuses":{"href":"https://api.github.com/repos/novoda/download-manager/statuses/e59a35e5a3eb798e045db5f97b35f52385c390bf"}},"author_association":"OWNER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"danybony","id":3942812,"avatar_url":"https://avatars3.githubusercontent.com/u/3942812?v=4","gravatar_id":"","url":"https://api.github.com/users/danybony","html_url":"https://github.com/danybony","followers_url":"https://api.github.com/users/danybony/followers","following_url":"https://api.github.com/users/danybony/following{/other_user}","gists_url":"https://api.github.com/users/danybony/gists{/gist_id}","starred_url":"https://api.github.com/users/danybony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danybony/subscriptions","organizations_url":"https://api.github.com/users/danybony/orgs","repos_url":"https://api.github.com/users/danybony/repos","events_url":"https://api.github.com/users/danybony/events{/privacy}","received_events_url":"https://api.github.com/users/danybony/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":14,"deletions":13,"changed_files":2}}
{"actor":{"display_login":"danybony"}}