Repository navigation
fix(cli): handle decoded cloud download responses - #5252
Closed
user-github-me wants to merge 1 commit into
Closed
user-github-me wants to merge 1 commit into
user-github-me wants to merge 1 commit into
Conversation
Collaborator
|
Thanks, this is a real fetch quirk, but neither caller currently gets a response with both |
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.
fetchdecodes content-encoded responses while retaining their compressedContent-Length. Cloud downloads compared the decoded bytes against that header and rejected valid gzip, deflate, and Brotli responses as truncated.Only use
Content-Lengthfor unencoded or identity responses. Content-encoded downloads report their received byte count with an unknown total; fetch and the stream pipeline continue to surface transfer errors and cancellation. Preserve atomic replacement and the existing output on failure.Validation: 119 cloud/client and cloud-command tests pass, including real HTTP coverage for gzip, x-gzip, mixed-case gzip, deflate, Brotli, stacked compression, identity, and an unknown coding. Six compressed-response regressions fail on current main. Interrupted and cancelled gzip transfers preserve the previous output; identity and unencoded truncation checks still pass. CLI build and typecheck, repository lint, formatting, and test reachability pass. A separate Node 22/local-HTTP probe reproduces the original 1,920-versus-51-byte false truncation and verifies the corrected bytes on disk.
Related: #3944 addresses a separate writer-close/cleanup race; this PR leaves that implementation to its existing author.