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

Progress reporting for large file downloads doesn't work well #40

Open
sjchristi opened this issue Jan 26, 2025 · 0 comments
Open

Progress reporting for large file downloads doesn't work well #40

sjchristi opened this issue Jan 26, 2025 · 0 comments

Comments

@sjchristi
Copy link
Contributor

Is this a bug report, a feature request, or a question?

bug report / question

We've had an issue where some users are telling us download aren't working. Some of the downloads in our app are quite large (> 1 GB). I looked into it, and it looks like it's caused by the progress callback not being triggered.

If you look at this code here:

if ([percent floatValue] - [prevPercent floatValue] > 0.01f) {

You will see a progress callback is only made if at least 1% of the progress has changed. But, for huge files, for example 1GB, that 1% is 10 megabytes. If a user is on a slow connection, that means they can be going 30 seconds+ without any sort of progress callback, which makes the user think the download is broken.

I'm going to create a fix for this issue, but was hoping that I could get some feedback @kesha-antonov

I had a couple ideas:

  • add a variable to control the max time between progress updates. If that time has elapsed and we haven't had a progress callback, then make the callback (was thinking I'd put this at ~10 seconds).
  • change the progress callback to not use percentage of file, but to also use some minimum size as well.. So for example, trigger the callback if > 1% of the progress has changed, OR there has been more than 1MB downloaded since last progress report

Any suggestions? Or other ideas? Would like to hear your ideas.

thanks,
Sam

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

No branches or pull requests

1 participant