[pull] main from MetaMask:main#722
Merged
pull[bot] merged 6 commits intoReality2byte:mainfrom Apr 30, 2026
Merged
Conversation
## **Description** Updates the Polymarket adapter contract addresses used by Predict to the new `CtfCollateralAdapter` and `NegRiskCtfCollateralAdapter` values shared by Polymarket. Polymarket added new events on these adapters and will stop accepting relayed transactions through the old adapters on May 1 at 3pm UTC. Without this change, Polymarket transactions routed through the old adapters will start failing. ## **Changelog** CHANGELOG entry: Updated Polymarket adapter contracts so Polymarket prediction transactions continue working after the relayer migration. ## **Related issues** Fixes: - PRED-853 - https://consensyssoftware.atlassian.net/browse/PRED-853 ## **Manual testing steps** ```gherkin Feature: Polymarket adapter migration Scenario: user submits a Polymarket transaction after the adapter migration Given the app is running a build from this branch And the user has access to the Predict/Polymarket experience When the user submits a Polymarket transaction that uses the collateral adapters Then the app should use the updated adapter addresses And the transaction should be accepted by the relayer after the migration cutoff ``` Not run locally; constants-only configuration update. ## **Screenshots/Recordings** Not applicable. ### **Before** Not applicable. ### **After** Not applicable. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Low code complexity, but changes production on-chain contract targets for Polymarket claim/relay flows; incorrect addresses would cause transactions to fail. > > **Overview** > Updates Predict’s Polymarket configuration to use new `CtfCollateralAdapter` and `NegRiskCtfCollateralAdapter` contract addresses in `polymarket/constants.ts`. > > This shifts v2 claim/relay routing (as referenced by protocol `claim.standardTarget`/`claim.negRiskTarget`) to the new adapter contracts to maintain compatibility with Polymarket’s relayer migration. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 08b08be. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…29553) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** Three independent improvements to the CI pipeline: - E2E merge gate fix: Gate now checks build jobs too (build-android-apks, build-ios-apps). Previously a failed build caused smoke tests to skip, which the gate treated as passing. This will avoid PRs getting merged with broken builds like: https://github.com/MetaMask/metamask-mobile/actions/runs/25074016847 - Yarn cache: Added node_modules + .yarn/install-state.gz caching to component-view-tests, merge-unit-and-component-view-tests, and setup-e2e-env. Saves ~2–4 min on cache hits. - Label rename: skip-e2e-quality-gate → skip-e2e-flakiness-detection. Post-merge: rename the label manually in GitHub repo settings. - Time-gated auto-labeling: The pr-not-ready-for-e2e label is now only auto-applied to new PRs opened between 13:00–17:00 UTC (15:00–19:00 CEST / 9:00–13:00 EDT), targeting the Europe–US East Coast overlap window. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Modifies CI workflow gating and label-driven behavior that can block or permit merges, so misconfiguration could affect release throughput. Changes are scoped to GitHub Actions/scripts and caching, with no app runtime impact. > > **Overview** > **CI merge gating is tightened for E2E** by treating failures/cancellations in `build-android-apks` and `build-ios-apps` as merge-blocking (previously a failed build could cause smoke tests to skip and still pass the gate), while still allowing intentional `skipped` outcomes when E2E is not expected to run. > > **Dependency caching is expanded** by caching `node_modules` plus `.yarn/install-state.gz` in the shared `setup-e2e-env` action and in `ci.yml` jobs that run component-view tests and coverage merge, skipping `yarn install` on cache hits. > > **Labeling/controls are updated**: `skip-e2e-quality-gate` is renamed to `skip-e2e-flakiness-detection` across scripts, rerun triggers, and docs; `auto-label-not-ready-for-e2e` is time-gated (13:00–17:00 UTC) before applying `pr-not-ready-for-e2e`; and documentation/ownership is updated (adds QA ownership for `E2E_DECISION_TREE.md` and clarifies `skip-e2e` as an exceptional “skip builds + all E2E” escape hatch). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ede188d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…ilds. (#29390) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** Adds automated build environment display to RC and production builds. Captures actual environment values used during builds (METAMASK_ENVIRONMENT, METAMASK_BUILD_TYPE, API URLs, etc.) and displays them: - RC builds: In PR comment alongside build links - Prod builds: Extracted via new workflow (Slack notification in follow-up PR). **Changes:** - scripts/apply-build-config.js: Add --write-build-env flag to generate build-env.json with actual env values - build.yml: Generate and upload build-env.json as artifact during builds (used by both RC and prod) - build-rc-auto.yml: Download build-env artifacts in post-rc-build-comment job - scripts/build-announce/: Add env section to RC build PR comments - prod-build-env-notify.yml: New workflow triggered on prod build completion, extracts env values (Slack posting in follow-up PR) <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-1108 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes CI build workflows and the RC PR-comment pipeline to generate, upload, download, and parse a new `build-env.json` artifact; misconfiguration could break build jobs or PR comment posting. Risk is limited to CI/reporting paths and is largely non-blocking (`continue-on-error`/`|| true`) but still touches release build automation. > > **Overview** > Adds generation of a `build-env.json` file during CI builds (via `scripts/apply-build-config.js --write-build-env`) and uploads it as a build artifact for each platform. > > Updates RC automation to download these artifacts and extends `scripts/build-announce` to parse them and include a **Build Environment** section (env/build type, remote FF mapping, key API URLs/flags) in the RC PR comment, with a fallback “not available” section on extraction failure. > > Introduces a new `Prod Build Env Notify` workflow that triggers on successful production workflow runs, downloads the `build-env` artifact, extracts key values with `jq`, and currently prints a placeholder for a future Slack notification; also ignores local `build-env.json` via `.gitignore`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0f0c4b5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR updates the post-#29305 CI requirement filters so locale translation JSON changes are treated as E2E-ignorable. Locale-only PRs under `locales/languages/**/*.json` should now skip Smart E2E selection plus Android/iOS E2E builds and smoke tests. The change also adds the same locale rule to the Android/iOS platform-or-ignorable filters, so mixed platform + locale changes keep platform-specific E2E behavior instead of expanding to both platforms. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: MCWP-440 ## **Manual testing steps** ```gherkin Feature: CI requirements for locale translation changes Scenario: locale translation PR skips E2E Given a pull request changes only files under locales/languages/**/*.json When the ci workflow runs get-requirements Then Smart E2E selection is skipped And Android E2E build and smoke test jobs are skipped And iOS E2E build and smoke test jobs are skipped And pr-not-ready-for-e2e does not block merge for the ignorable-only change ``` ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [x] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [x] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
…-1778) (#29576) ## **Description** Tier 2 of MMQA-1364 (allowlist reduction). Adds default mock matchers for three categories of static asset / health-check requests, then removes the corresponding entries from `mock-e2e-allowlist.ts`. | Matcher | Response | | --- | --- | | `^https://clients3\.google\.com/generate_204$` (HEAD) | `204 No Content`, empty body | | `^https://raw\.githubusercontent\.com/MetaMask/contract-metadata/[^/]+/images/.+\.svg$` (GET) | `200`, minimal `<svg xmlns="http://www.w3.org/2000/svg"/>` | | `^https://token\.api\.cx\.metamask\.io/assets/nativeCurrencyLogos/.+\.svg$` (GET) | `200`, minimal SVG | **Why regex, not exact URLs.** The previous allowlist enumerated five specific token icons that today's specs happened to load. Any new spec, new default token, branch rename (`master` → `main`), or platform-subset divergence would reintroduce live requests. Regex matchers cover the entire category (any branch, any future token icon) with one entry — a one-time fix instead of a moving target. **`generate_204` origin.** Confirmed it is fired by `@react-native-community/netinfo`'s `InternetReachability._checkInternetReachability` via JS-layer `fetch`. That path is patched by `shim.js`, so the request reaches mockttp at `/proxy?url=…` and the matcher fires. (Method is `HEAD`, hence the new `HEAD` field on `DEFAULT_MOCKS`.) ### Files changed - `tests/api-mocking/mock-responses/defaults/static-assets.ts` — new default mock file with the three matchers - `tests/api-mocking/mock-responses/defaults/index.ts` — imported and spread into `DEFAULT_MOCKS.GET` + new `HEAD` field - `tests/api-mocking/mock-e2e-allowlist.ts` — removed 7 entries (1 generate_204, 5 GitHub raw token SVGs, 1 token.api nativeCurrencyLogos ethereum.svg) ### Out of scope - `https://api.avax.network/ext/bc/C/rpc` — Tier 4 investigation - `https://metamask.github.io/test-dapp/metamask-fox.svg` — handled by MMQA-1367 - Polymarket hosts — separate follow-up tracked in MMQA-1755 ## **Changelog** CHANGELOG entry: null ## **Related issues** [MMQA-1778](https://consensyssoftware.atlassian.net/browse/MMQA-1778) — parent epic [MMQA-1364](https://consensyssoftware.atlassian.net/browse/MMQA-1364) ## **Manual testing steps** ```gherkin Feature: Static asset mocks for E2E tests Scenario: NetInfo reachability probe is mocked Given the E2E mock server is running with default mocks loaded When the app fires the NetInfo reachability probe (HEAD https://clients3.google.com/generate_204) Then mockttp returns 204 with empty body And validateLiveRequests() does not record a live request Scenario: Token icon SVGs are mocked Given a spec loads a token list that includes contract-metadata icons When the app requests https://raw.githubusercontent.com/MetaMask/contract-metadata/<branch>/images/<token>.svg Then mockttp returns 200 with a placeholder SVG And the request never reaches GitHub live Scenario: Native currency logo SVGs are mocked Given a spec loads a chain whose native currency logo is fetched from token.api When the app requests https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/<chain>.svg Then mockttp returns 200 with a placeholder SVG And the request never reaches the live token.api endpoint ``` ## **Screenshots/Recordings** ### **Before** `tests/api-mocking/mock-e2e-allowlist.ts` allowlisted 7 entries that bypassed `validateLiveRequests()`: What this meant on every E2E run: - NetInfo's reachability probe fired a live `HEAD https://clients3.google.com/generate_204` and Google answered. The allowlist silenced the warning, so `validateLiveRequests()` did not flag it. - 5 GitHub raw SVG fetches went live whenever notifications rendered token icons (USDC/SHIB/USDT/stETH/rETH from the mocked notification fixtures in `@metamask/notification-services-controller`). - 1 `token.api` SVG went live whenever the Ethereum native-currency logo was loaded (referenced in `app/constants/urls.ts:144` and the Ramp Quotes constants). ### **After** Allowlist with the 7 entries gone — `ALLOWLISTED_URLS` drops from 16 to 9: What happens on every E2E run now: - **NetInfo reachability probe** → mockttp returns `204` with empty body. NetInfo's `reachabilityTest` (`response.status === 204`) passes; the wallet sees the network as reachable. No live request to Google. - **Notification SVG fetches** → mockttp returns a placeholder SVG (`<svg xmlns="http://www.w3.org/2000/svg"/>`). Icons render (visual fidelity not asserted in E2E). No live request to `raw.githubusercontent.com` for any token icon — current or future. - **Native currency logo fetch** → same placeholder SVG. No live request to `token.api.cx.metamask.io` for any chain's logo. - `validateLiveRequests()` records **zero** leaks for these endpoints. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [MMQA-1778]: https://consensyssoftware.atlassian.net/browse/MMQA-1778?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes are confined to the E2E mocking layer, replacing live allowlisted static/health-check requests with deterministic mocks (including adding default `HEAD` mocks). > > **Overview** > Reduces E2E live network allowlisting by removing specific static/health-check URLs (Google `generate_204` and token SVG icon URLs) from `mock-e2e-allowlist.ts` and handling them via default mocks instead. > > Adds `STATIC_ASSETS_MOCKS` with regex-based matchers that return a `204` for `HEAD https://clients3.google.com/generate_204` and a minimal SVG for GitHub contract-metadata and `token.api` native currency logo `.svg` requests, and wires these into `DEFAULT_MOCKS` (including a new `HEAD` entry). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7c90df2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->
## **Description**
On iOS<16, Detox’s device.sendToHome() brings the home screen to the
front. On iOS 16 and later, that path is not used the same way from the
simulator tooling, so Detox instead launches and immediately quits the
Settings app to put the app under test in the background. That can
briefly show Settings and race the next step.
This PR tightens tests/smoke/swap/swap-deeplink-smoke.spec.ts: a 1
second wait after sendToHome() before launchApp({ url }), newInstance:
false on those launchApp calls so the flow is clearly “same app
instance, URL delivered after background,” and short comments above each
wait explaining the pre‑16 vs 16+ behavior.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.
Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
#### Performance checks (if applicable)
- [x] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **Pre-merge reviewer checklist**
<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only changes that adjust Detox app launching behavior and add
additional HTTP mocks; low risk to production code, with minor risk of
masking real integration issues if mock matching is too broad.
>
> **Overview**
> Stabilizes swap deeplink smoke tests on iOS by adding a short
post-`sendToHome()` delay and launching deeplinks with `newInstance:
false` to ensure URLs are delivered to the existing app instance.
>
> Expands swap E2E mocking by introducing reusable
`setupSwapSocialAndComplianceMocks()` to stub the Social leaderboard and
compliance batch endpoints, wiring it into swap and trending-token smoke
setups. Also tightens the swap proxy URL interception so the
`insufficientBal` rewrite only targets JSON `getQuote` requests (not
`getQuoteStream`).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
edbfe2c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )