Throttled download progress only updates if another byte arrives
Categories
(Toolkit :: Downloads API, defect, P3)
Tracking
()
People
(Reporter: dmcintosh, Assigned: dmcintosh)
Details
Attachments
(2 files)
When downloading a file, Firefox doesn't update the progress if it was less than 400ms since the last update. However, if no more bytes arrive for a while afterwards, Firefox can be left displaying an incorrect progress measure.
For example, I can try running the attached Python script (I'm on Windows 11 24H2). It sends 4KiB immediately, then ~80KiB after that. I would expect that Firefox updates to 84KiB at some point before finishing the download, but instead it appears to go instantaneously from 4KiB to 84KiB as it finishes.
I found this while writing a new set of tests for my DownloadsTaskbar changes; they wait for the progress to update, but that doesn't happen! It isn't really a problem for general use, unless your connection cuts out for a good few seconds.
I'll attach a Phabricator patch that appears to fix it; I suspect it internally needs work, as well as needing tests, but it does appear to fix the problem.
[Aside: could it make sense to reduce the timeout from 400ms to e.g. 200ms? I don't think updating the progress is that CPU-intensive, and it might look a bit smoother, but it's also not that important how long it is.]
| Assignee | ||
Comment 1•9 months ago
|
||
Comment 2•8 months ago
|
||
The severity field is not set for this bug.
:mak, could you have a look please?
For more information, please visit BugBot documentation.
Comment 3•8 months ago
|
||
I think this is a valid idea, the code could be simplified by just calling again _SetBytes with the same arguments, the patch seems to do a bit more (e.g. hasPartialData was already set, it may not be necessary to use a repeating timer, since _setBytes will likely be invoked again and it can see there's already a timer and let it be...)
Updating the progress indicator is expensive when there's lots of windows.
Updated•8 months ago
|
Description
•