Repository navigation
fix: upgrade mockttp to 4.6.5 to resolve @graphql-tools/utils advisory - #40542
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
| "@react-native-community/viewpager": "patch:@react-native-community/viewpager@npm%3A3.3.0#~/.yarn/patches/@react-native-community-viewpager-npm-3.3.0.patch", | ||
| "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.5", | ||
| "@appium/schema/json-schema": "^0.4.0", | ||
| "@metamask/react-native-payments/validator": "^13.7.0", |
There was a problem hiding this comment.
react-native-payments does not use validator anymore
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
|
@SocketSecurity ignore npm/tslib@2.9.1
|
…sk/metamask-mobile into fix/mockttp-4-graphql-tools-utils
Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
Restores STRATEGY.md and marketing-consent-use-cases.md to main's content. The merge of main had reformatted them; no content changes. Co-authored-by: Cursor <cursoragent@cursor.com>
|



Description
Upgrades
mockttp, the E2E mock server (test-only), from 3.15.2 to 4.6.5 and removes1241230(MCWP-1041) fromnpmAuditIgnoreAdvisories.@graphql-tools/utils: mockttp 3.x pulled in
@graphql-tools/utils@8.9.0and8.13.1(via@graphql-tools/schema@8andmerge@8), affected by GHSA-7mx3-vvmw-hjmv (high, prototype pollution inmergeDeep). No 3.x mockttp release has a fix. mockttp 4.6.5 depends onutils@^12.0.3andschema@^10, so the tree now hasutils@12.1.0with no pins needed.mockttp 4 follow-ups:
package.json: removed themockttp@npm:3.15.2/body-parserpin (4.x no longer uses body-parser). Added"mockttp>tls-impersonate": falsetoallowScripts. It's an optional native addon that ships prebuilds for every platform we use and loads without its install script.jest.config.js: transpile ESM-onlymilliparsecandget-port7 (nested under mockttp).tests/api-mocking/helpers/cryptoRandomUUID.ts: mockttp 4 callsglobalThis.crypto.randomUUID(), which the shared Jest crypto stub lacks. The four unit suites that start a mockttp server install Node'srandomUUIDinbeforeAll. This is scoped on purpose: adding it to the global stub would switch every test'suuid.v4()to a different code path.tests/smoke/identity/utils/mocks.ts:body.getJson<object>(), sincegetJson()now types JSON primitives too.thenForwardTo/forwarding, handler classes,getRemote, CA generation, orstatusin callback results).validator: also removes the
"@metamask/react-native-payments/validator"resolution, which no longer matches anything. It was added in #9483 forreact-native-payments@2.0.0(validator@^7), and 2.0.1+ dropped the dependency.Verification:
yarn install --immutableandyarn audit:cipass. A full audit with--environment allreports no new advisories.yarn allow-scripts listshows no unconfigured packages.yarn lint:tscpasses, and ESLint and Prettier are clean on changed files.tests/pass (3,262 tests), including the mockttp server suites, andNotificationsView.view.test.tsxpasses.getLocal()withthenJsonandthenCallbackworks in plain Node 24 (the Appium runner path).Test layer placement
No new tests. Existing unit suites that start a mockttp server now call
installCryptoRandomUUIDinbeforeAll. E2E coverage comes from the Appium smoke run in CI.Changelog
CHANGELOG entry:null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-1041
Manual testing steps
Screenshots/Recordings
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Test-only mock server and dependency lockfile changes with no production app logic touched; main risk is E2E/unit suites that depend on mockttp behavior.
Overview
Upgrades the E2E mock server dependency
mockttpfrom 3.15.2 to 4.6.5 so the dependency tree picks up@graphql-tools/utils@12.xinstead of the vulnerable 8.x line, and removes the MCWP-1041 audit ignore from.yarnrc.yml.Supporting changes keep tests and installs working on mockttp 4: Jest transpiles ESM-only
milliparsecandget-port; LavaMoat disables install scripts for optionalmockttp>tls-impersonate; obsolete Yarn resolutions are dropped (mockttp 3body-parserpin and unused@metamask/react-native-payments/validator).Test harness updates: a scoped
installCryptoRandomUUIDhelper is wired into the unit suites that start a local mockttp server, and smoke mocks usebody.getJson<object>()for mockttp 4’s typing.Reviewed by Cursor Bugbot for commit d6b77b5. Bugbot is set up for automated code reviews on this repo. Configure here.