fix(registry): retry and validate upstream packument responses#17
Merged
jacekradko merged 7 commits intomainfrom Mar 31, 2026
Merged
fix(registry): retry and validate upstream packument responses#17jacekradko merged 7 commits intomainfrom
jacekradko merged 7 commits intomainfrom
Conversation
msw pulled in ~30 transitive deps (graphql, tough-cookie, yargs, etc.) to test a single function that calls fetch. spyOn(globalThis, 'fetch') does the same job with zero new dependencies.
nikosdouvlis
approved these changes
Mar 31, 2026
Member
|
Pushed a commit swapping msw for Also should we drop the per-attempt timeout from 30s to 15s? Worst case right now is 30s x 3 attempts = ~91.5s to block an install, which feels like a lot |
nikosdouvlis
added a commit
that referenced
this pull request
Apr 1, 2026
nikosdouvlis
added a commit
that referenced
this pull request
Apr 1, 2026
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
Fixes transient CI failures where
pkglab addfails because the upstream npm registry proxy returns truncated/corrupted JSON packuments. Seen in clerk/javascript CI wherenpm installfailed with:Root cause:
proxyToUpstreamstreamed the upstream response body directly to the client. For large packuments (~4MB fortypescript), a network hiccup could truncate the stream, serving corrupted JSON to npm.Fix:
JSON.parse()before serving. If the JSON is corrupted, the request is retried.Test plan
bun tsc --noEmit)