Repository navigation
finish a chunked transfer when the length is an exact multiple - #2004
Merged
gildas-lormeau merged 2 commits intoSep 27, 2026
Merged
gildas-lormeau merged 2 commits into
gildas-lormeau merged 2 commits into
Conversation
The last block used >, so a payload of 32 MiB or 48 MiB never set finished and the save stayed open.
Owner
|
Thanks! I removed |
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.
Summary
A chunked save sets
finishedwhen the next offset is past the end of the payload. On an exact multiple of the chunk size that comparison stays false for the last block, so the background page never writes the file. The download fallback, the editor tab data, and the editor open path all used that comparison.16 MiB still goes out as a single block. 32 MiB and 48 MiB now finish on the last block.
The fetch sender walks with
<=and already marks the following empty block finished. That path is left as it is.Test plan
test/chunk-finished.test.js: exact 2× and 3× chunks, one unit under and over, a single chunk, an empty payload, 16 / 32 / 48 MiB, and 32 MiB ± 1npm test: 29 passed./build.sh; the committed bundles include the same>=check