Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports already downloaded bytes as downloaded #47

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

cuducos
Copy link
Owner

@cuducos cuducos commented Aug 23, 2023

As far as I got, we just send a DownloadStatus updating the total downloaded size if we try to download a chunk. This means that for chunks downloaded in previous runs, their bytes would be missing from the total count (i.e. DownloadedFileBytes). I am not sure whether this is intended or not.

  • On the one hand, they are not downloaded in this run, so they might not be reported as they would mean something downloaded in another moment/context
  • On the other hand, if we don't report them, the download will complete successfully, but DownloadedFileBytes will not match the expected file size in the last status

Since most of download managers count the bytes downloaded previously towards the total bytes downloaded, I suggest we add these lines. Any ideas? Any ideas about how to test that behavior?

Copy link
Collaborator

@danielfireman danielfireman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of reporting the previously downloaded bytes.

About the test, one possible way is get inspiration from TestDownload_Retry idea, but add a check for the first Status received after the timeout or error. How does that sound? Am I missing something?

@cuducos cuducos force-pushed the fix-report-already-downloaded-bytes branch from 666c9d8 to bcc817a Compare August 26, 2023 15:58
@cuducos
Copy link
Owner Author

cuducos commented Aug 26, 2023

Awesome! Nice inspiration indeed : )

@cuducos cuducos force-pushed the fix-report-already-downloaded-bytes branch from bcc817a to bcd66f6 Compare August 26, 2023 15:58
@cuducos cuducos merged commit e62f47a into main Aug 26, 2023
16 checks passed
@cuducos cuducos deleted the fix-report-already-downloaded-bytes branch October 24, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants