-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor: Simplify NPM fetching logic #21412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+90
−88
Conversation
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
6b75a69
to
7c8c8a6
Compare
Mrtenz
requested changes
Oct 21, 2025
Mrtenz
previously approved these changes
Oct 21, 2025
Mrtenz
previously approved these changes
Oct 21, 2025
Mrtenz
approved these changes
Oct 21, 2025
66ff514
to
46c1840
Compare
|
Missing release label release-7.58.0 on PR. Adding release label release-7.58.0 on PR and removing other release labels(release-7.59.0), as PR was added to branch 7.58.0 when release was cut. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
INVALID-PR-TEMPLATE
PR's body doesn't match template
no-changelog
no-changelog Indicates no external facing user changes, therefore no changelog documentation needed
release-7.58.0
Issue or pull request that will be included in release 7.58.0
run-android-flask-e2e-smoke
Run Android flask E2E tests on next CI run
size-M
team-core-platform
Core Platform team
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.
Description
Simplify the NPM fetching implementation to make it more readable, while also fixing a couple of issues:
Changelog
CHANGELOG entry: null
Related issues
Closes: MetaMask/snaps#3617
Note
Refactors NPM tarball fetching with direct blob fetch, status/size validation, improved error handling, and robust cleanup; updates tests to match.
NpmLocation.fetchNpmTarball
to useReactNativeBlobUtil.config({ appendExt: 'tgz' }).fetch
andRNTar.unTar
.content-length
againstTARBALL_SIZE_SAFETY_LIMIT
.getErrorMessage
; acceptDetectSnapLocationOptions
via constructor.finally
:response.flush()
andfs.unlink
of unpacked path.readAndParseAt
; removestringToBytes
.decompressFile
,fetchAndStoreNPMPackage
,cleanupFileSystem
; dropSNAPS_NPM_LOG_TAG
.respInfo
withstatus
andcontent-length
; adjust FS mocks; align with new fetch/untar flow.Written by Cursor Bugbot for commit 46c1840. This will update automatically on new commits. Configure here.