Repository navigation
Send a download's progress once its forward index is stored - #152
Merged
Merged
Conversation
On a host that ignores Range, the Jobs worker sent each progress report before it stored the snapshot of the entries found so far. The element asks whether the frame can boot on every report, and the Service Worker answers from the stored snapshot, so a report that overtook its write was answered from the one before, and the next report was a chunk away. For a package under two chunks that meant the whole download. The publishing moves into IndexPublisher, whose report() sends once the write it waits for has landed or been refused, in order. Closes #144.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #144.
On a host that ignores
Range, the Jobs worker sent each progress report before it stored the snapshot of the entries found so far. The element asks the Service Worker whether the frame can boot on every report, and the worker answers from the stored snapshot. A report that overtook its write was therefore answered from the snapshot before, and nothing asked again until the next report, a chunk (256 kB) later. For a package under two chunks, the first report is also the last before the download ends, so the frame waited for all of it. That is thepack.test.tsfailure CI's Firefox runner hits now and then (#75, #144).What changes
IndexPublisher(src/jobs/index-publisher.ts) holds whatdownloadArchivedid inline: storing the snapshot when the scanner has found more, one write at a time, a refused write dropped with one warning, and the final snapshot written at the end. Itsreport(send)sends a progress report once the write it waits for has landed or been refused. With nothing new to store, a report waits only for the writes already under way, so reports keep their order, and the last one still goes out beforedone.jobs-worker.tsuses it, so itsonProgressis one line.design/serving.md: a sentence on the order, under An archive from a host that ignoresRangeis indexed as it downloads.Checked
index-publisher.test.ts, four new unit tests with a store whose writes land when the test says:The first two fail when
reportsends first, as the old code did.The issue's proof, end to end: with
setForwardIndexdelayed by 400 ms,pack.test.ts"attaches the parts while a download from a host without Range is under way" failed three times out of three with the old order, with the CI error ('probing', 'downloading', …(2)). With this change it passed three out of three. The delay was a one-off edit, reverted.The player's suite in Chromium: 602 tests, unit and both browser projects.
pack.test.tsin Firefox, five runs of 20 tests: all pass. CI runs the browser suite in Firefox and WebKit.Release: a fix in the player's next minor, the one that moves the pin to pack 1.1.0.