Skip to content

chore(ramps): remove the rampsEnabled feature flag - #47459

Merged
wenfix merged 3 commits into
mainfrom
chore/remove-ramps-enabled-flag
Nov 9, 2026
Merged

wenfix merged 3 commits into
mainfrom
chore/remove-ramps-enabled-flag

Conversation

@wenfix

@wenfix wenfix commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes the fully rolled-out rampsEnabled remote feature flag. Its production default is already { enabled: true, minimumVersion: '13.48.0' }, so this deletes the off-path rather than changing behavior for supported versions.

This is a prerequisite for the /buy deep-link work in #46498, which currently has to thread the flag through the deep-link router. Landing the removal first keeps that PR free of rollout-gate plumbing.

Changes:

  • Deletes getIsRampsEnabled from ui/selectors/ramps-feature-flags.ts and its selector tests.
  • Removes the !isEnabled → open Portfolio branch from useRampsNavigation.
  • Removes the analytics no-op guard from useRampsAnalytics and the flag check from useRampsScreenViewed.
  • Removes rampsEnabled from the e2e feature-flag registry.
  • Keeps rampsServiceDisruption as the service kill switch.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

  1. Run the extension.
  2. Open the Buy flow from the wallet (e.g. the Buy button or token list) and verify it opens the in-app unified buy flow.
  3. Advance through token selection and provider selection, then verify ramps-* events still fire in the Segment debugger.
  4. Turn on the rampsServiceDisruption remote flag (or override it locally) and verify the service-disruption modal is still shown.
  5. Open a /buy deep link from a dapp and verify its routing is unchanged by this PR (the routing change is in feat(ramps): route /buy deep links into the in-app unified buy flow #46498).

Pre-merge author checklist

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.

Note

Medium Risk
Changes default Buy routing for any client that still had rampsEnabled off, and removes analytics silencing tied to that flag; rampsServiceDisruption behavior is unchanged.

Overview
Removes the fully rolled-out rampsEnabled remote flag so the in-app ramps buy path is always used instead of treating “flag off” as “open Portfolio.” getIsRampsEnabled and its selector tests are deleted; rampsEnabled is dropped from the E2E feature-flag registry. rampsServiceDisruption stays as the kill switch.

useRampsNavigation.goToBuy no longer short-circuits to openBuyCryptoInPdapp when the rollout flag was false—Portfolio migration, geo, disruption, and native routing behave as they did when the flag was on. useRampsAnalytics and useRampsScreenViewed no longer skip ramps-* events when the flag was off.

Tests drop flag-gating cases and align Buy entry assertions with goToBuy (wallet overviews, asset page); ramps UI tests stub analytics where the background connection is not initialized.

Reviewed by Cursor Bugbot for commit 6cc38b5. Bugbot is set up for automated code reviews on this repo. Configure here.

@wenfix wenfix added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed team-money-movement labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamask-ci

metamask-ci Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/money-movement (8 files, +33 -131)
  • 📁 ui/
    • 📁 hooks/
      • 📁 ramps/
        • 📁 useRampsNavigation/
          • 📄 useRampsNavigation.test.tsx +5 -23
          • 📄 useRampsNavigation.ts +1 -16
          • 📄 useRampsAnalytics.test.tsx +2 -16
          • 📄 useRampsAnalytics.ts +1 -11
          • 📄 useRampsScreenViewed.test.tsx +2 -60
          • 📄 useRampsScreenViewed.ts +2 -5
    • 📁 pages/
      • 📁 ramps/
        • 📁 provider-selection/
          • 📄 provider-selection.test.tsx +10 -0
        • 📁 token-selection/
          • 📄 token-selection.test.tsx +10 -0

@metamask-ci

metamask-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor
Builds ready [2c72167]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 4 warn · 🔴 2 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 40733644656 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]

Regressions (🔴 2 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +418%
  • ↑ loadNewAccount/total: +418%
  • ↑ loadNewAccount/fcp: +11%
  • ↑ confirmTx/longTaskTotalDuration: +69%
  • ↑ confirmTx/longTaskMaxDuration: +106%
  • ↑ confirmTx/tbt: +122%
  • ↑ confirmTx/fcp: +13%
  • ↑ confirmTx/lcp: +22%
  • ↑ bridgeUserActions/bridge_load_page: +125%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +119%
  • ↑ bridgeUserActions/longTaskCount: +67%
  • ↑ bridgeUserActions/longTaskTotalDuration: +157%
  • ↑ bridgeUserActions/longTaskMaxDuration: +74%
  • ↑ bridgeUserActions/tbt: +348%
  • ↑ bridgeUserActions/total: +17%
  • ↑ bridgeUserActions/fcp: +15%
  • ↑ loadNewAccount/load_new_account: +417%
  • ↑ loadNewAccount/total: +417%
  • ↑ loadNewAccount/inp: +59%
  • ↓ loadNewAccount/fcp: -73%
  • ↑ loadNewAccount/lcp: +801%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -55%
  • ↓ confirmTx/fcp: -64%
  • ↑ confirmTx/lcp: +1086%
  • ↑ bridgeUserActions/bridge_load_page: +114%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +82%
  • ↓ bridgeUserActions/bridge_search_token: -16%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↓ bridgeUserActions/fcp: -71%
  • ↑ bridgeUserActions/lcp: +773%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 2.0s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -20%
  • ↓ startupStandardHome/load: -22%
  • ↓ startupStandardHome/domContentLoaded: -22%
  • ↓ startupStandardHome/firstPaint: -12%
  • ↓ startupStandardHome/backgroundConnect: -27%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -33%
  • ↓ startupStandardHome/loadScripts: -23%
  • ↑ startupStandardHome/setupStore: +82%
  • ↓ startupStandardHome/longTaskCount: -33%
  • ↓ startupStandardHome/longTaskTotalDuration: -32%
  • ↓ startupStandardHome/longTaskMaxDuration: -30%
  • ↓ startupStandardHome/tbt: -32%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -25%
  • ↓ startupStandardHome/lcp: -10%
  • ↓ startupStandardHome/domInteractive: -37%
  • ↑ startupStandardHome/backgroundConnect: +10%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +147%
  • ↓ startupStandardHome/fcp: -34%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +51%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +45%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +81%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +20%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -75%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↑ onboardingNewWallet/srpButtonToPwForm: +51%
  • ↑ onboardingNewWallet/createPwToRecoveryScreen: +27%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +24%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +17%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -76%
  • ↓ onboardingNewWallet/longTaskCount: -69%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -69%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -47%
  • ↓ onboardingNewWallet/tbt: -91%
  • ↓ onboardingNewWallet/total: -72%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -69%
  • ↓ dappPageLoad/domContentLoaded: -27%
  • ↓ dappPageLoad/firstPaint: -50%
  • ↓ dappPageLoad/firstContentfulPaint: -50%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.4 MiB +125 Bytes 0.00%
✅ ui 19.26 MiB -314 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.75 MiB -184 Bytes 0.00%
✅ zip 24.04 MiB -48 Bytes 0.00%

@metamask-ci

metamask-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor
Builds ready [6cc38b5] [reused from dd86daf]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 2 warn · 🔴 2 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 40742968909 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]

Regressions (🔴 2 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +417%
  • ↑ loadNewAccount/total: +417%
  • ↓ loadNewAccount/inp: -17%
  • ↑ confirmTx/longTaskTotalDuration: +48%
  • ↑ confirmTx/longTaskMaxDuration: +83%
  • ↑ confirmTx/tbt: +84%
  • ↓ confirmTx/inp: -17%
  • ↑ bridgeUserActions/bridge_load_page: +82%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +108%
  • ↑ bridgeUserActions/longTaskCount: +67%
  • ↑ bridgeUserActions/longTaskTotalDuration: +89%
  • ↑ bridgeUserActions/longTaskMaxDuration: +17%
  • ↑ bridgeUserActions/tbt: +139%
  • ↑ bridgeUserActions/total: +13%
  • ↑ loadNewAccount/load_new_account: +421%
  • ↑ loadNewAccount/total: +421%
  • ↓ loadNewAccount/inp: -17%
  • ↑ loadNewAccount/fcp: +20%
  • ↑ loadNewAccount/lcp: +1292%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -24%
  • ↓ confirmTx/fcp: -33%
  • ↑ confirmTx/lcp: +1375%
  • ↑ bridgeUserActions/bridge_load_page: +350%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +104%
  • ↑ bridgeUserActions/bridge_search_token: +24%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +58%
  • ↑ bridgeUserActions/inp: +54%
  • ↑ bridgeUserActions/fcp: +19%
  • ↑ bridgeUserActions/lcp: +1312%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.1s
  • 🟡 bridgeUserActions/FCP: p75 2.1s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/domInteractive: +17%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -33%
  • ↑ startupStandardHome/setupStore: +195%
  • ↓ startupStandardHome/longTaskCount: -33%
  • ↓ startupStandardHome/domInteractive: -39%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +153%
  • ↓ startupStandardHome/fcp: -35%
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +62%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +55%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +50%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +29%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -86%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -96%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -92%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↓ onboardingNewWallet/srpButtonToPwForm: -22%
  • ↓ onboardingNewWallet/createPwToRecoveryScreen: -20%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -80%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -77%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -54%
  • ↓ dappPageLoad/firstPaint: -32%
  • ↓ dappPageLoad/firstContentfulPaint: -32%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.4 MiB +125 Bytes 0.00%
✅ ui 19.26 MiB -314 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.75 MiB -184 Bytes 0.00%
✅ zip 24.04 MiB -48 Bytes 0.00%

@sonarqubecloud

Copy link
Copy Markdown

@wenfix
wenfix marked this pull request as ready for review October 28, 2026 19:27
@wenfix
wenfix requested a review from a team as a code owner October 28, 2026 19:27
@wenfix
wenfix deployed to segment-schema October 28, 2026 19:27 — with GitHub Actions Active
@wenfix
wenfix added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 7005dc7 Nov 9, 2026
154 checks passed
@wenfix
wenfix deleted the chore/remove-ramps-enabled-flag branch November 9, 2026 16:13
LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 11, 2026
…etaMask#46498)

## **Description**

`link.metamask.io/buy` deep links now route into the in-app Buy flow
instead of redirecting to Portfolio, so the link's token is preselected
and buyers get the same eligibility checks as the in-app Buy button.
Mobile already does this
([TRAM-3853](https://consensyssoftware.atlassian.net/browse/TRAM-3853)).

`/buy` lands on a new entry page (`/ramps/buy-deeplink-entry`) that maps
the link params (`assetId`, or `address` + `chainId`) to a CAIP-19 asset
and hands off to the existing `goToBuy`. Users who have connected to
Portfolio before are still redirected there with the link params
unchanged, but now via the extension (a locked wallet must be unlocked
first).

The same routing applies to `/buy` links in the carousel and
notifications. `DeepLinkUsed` now fires for `/buy` links that route
in-app.

**Interstitial:** unchanged. The destination is resolved outside the
interstitial decision, which is untouched, so the interstitial shows
exactly as often as before.

> [!NOTE]
> Stacked on MetaMask#47459, which removes the `rampsEnabled` flag. This PR is
rebased on that branch; the diff is the deep-link routing only.

## **Changelog**

CHANGELOG entry: Routed Buy deep links into the in-app Buy flow with the
token preselected.

## **Related issues**

Fixes:
[TRAM-3853](https://consensyssoftware.atlassian.net/browse/TRAM-3853)
Stacked on: MetaMask#47459

## **Manual testing steps**

**Setup:**

1. Run `yarn build:test`, then Chrome → `chrome://extensions` → **Load
unpacked** → `dist/chrome`; create/import a wallet and unlock it.
2. If a "Basic functionality is off" page appears, enable it once — it
persists for the session.
3. Every scenario below works the same way: paste the URL into any tab's
address bar. The pasted tab may error or stay blank — **expected**. The
interstitial opens in a **new tab** ("Proceed with caution…") → click
**Continue** → observe the result.
4. Between scenarios, close the extension tab(s) that opened.

#### Happy paths

**A1. Plain `/buy`** → in-app **token selection**
(`#/ramps/token-selection`); the wallet stays in the extension tab, no
Portfolio tab.

```
https://link.metamask.io/buy
```

**A2. DAI via EVM params** → build-quote with **"Buy DAI / on
Ethereum"** preselected.

```
https://link.metamask.io/buy?address=0x6b175474e89094c44da98b954eedeac495271d0f&chainId=1
```

**A3. Zero address (native token)** → **"Buy ETH / on Ethereum"**
preselected.

```
https://link.metamask.io/buy?address=0x0000000000000000000000000000000000000000&chainId=1
```

**A4. CAIP-19 `assetId`** → **"Buy DAI"** preselected (same as A2,
different param style).

```
https://link.metamask.io/buy?assetId=eip155:1/erc20:0x6B175474E89094C44Da98b954EedeAC495271d0F
```

**A5. `assetId` precedence** → **"Buy DAI"**: `assetId` wins, the
conflicting native-token params are ignored.

```
https://link.metamask.io/buy?assetId=eip155:1/erc20:0x6B175474E89094C44Da98b954EedeAC495271d0F&address=0x0000000000000000000000000000000000000000&chainId=1
```

#### Error & invalid-input handling

**B1. Token not in the catalog** → "Buying crypto isn't supported…"
modal; dismiss → back on **wallet home**, not a spinner.

```
https://link.metamask.io/buy?address=0x1111111111111111111111111111111111111111&chainId=1
```

**B2. Garbage `assetId`** → **Token selection**; the invalid param is
silently dropped, no crash.

```
https://link.metamask.io/buy?assetId=garbage
```

**B3. Garbage `chainId` + invalid address** → **Token selection**, no
crash.

```
https://link.metamask.io/buy?chainId=abc&address=0xzz
```

**B4. Well-formed non-Mainnet link (USDC on Polygon)** → **"Buy USDC /
on Polygon"** if it's in the live catalog, else the unsupported modal →
home.

```
https://link.metamask.io/buy?address=0x3c499c542cef5e901a0079a8bb6c6e4e07c8db10&chainId=137
```

#### Security & invariants

**C1. Interstitial is always shown** → interstitial with *"You'll open
the buy page if you continue."* Nothing auto-navigates.

```
https://link.metamask.io/buy
```

**C2. Invalid signature does not bypass** → **still the interstitial** —
no 404, no auto-entry; then Continue → "Buy DAI" normally.

```
https://link.metamask.io/buy?address=0x6b175474e89094c44da98b954eedeac495271d0f&chainId=1&sig_params=address%2CchainId&sig=AAAAinvalidsignatureAAAA
```

**C3. Locked wallet** → lock the wallet, then paste. Interstitial →
Continue → unlock prompt → **"Buy DAI"** (the link is not lost).

```
https://link.metamask.io/buy?address=0x6b175474e89094c44da98b954eedeac495271d0f&chainId=1
```

**C4. Back button does not bounce** → run A2, then press the browser
**Back** button. You land on the interstitial page and it **stays** — no
bounce back, no re-run, no duplicate history entries.

#### Cold start (quit Chrome fully with ⌘Q, relaunch, unlock, wait ~5s —
the tokens catalog is empty on arrival)

**D1. Token link after restart** → **"Buy DAI" build-quote** after a
brief spinner while the catalog is fetched on demand. Must **never**
show the "Buying crypto isn't supported / not available" modal.

```
https://link.metamask.io/buy?address=0x6b175474e89094c44da98b954eedeac495271d0f&chainId=1
```

**D2. Param-less link after restart** → **Token selection** — not
stranded on the spinner, not the unsupported modal.

```
https://link.metamask.io/buy
```

## **Screenshots/Recordings**


### **After**

#### Happy paths


https://github.com/user-attachments/assets/1b1f1d7a-4c1e-4efb-96c1-e75346f00b86


https://github.com/user-attachments/assets/62ec7ef3-ecd7-4517-96aa-5fcef3234cfe



https://github.com/user-attachments/assets/fcab5ef9-909a-49f3-aaad-5d959735555b



https://github.com/user-attachments/assets/c9ce4ad9-d25f-417a-9c11-17c6e3049c4a



https://github.com/user-attachments/assets/a7ec78d5-3272-40d3-b042-45cda425f56f

#### Error & invalid-input handling


https://github.com/user-attachments/assets/2fa693a3-85cd-40d7-8995-16e63d82482e



https://github.com/user-attachments/assets/3250deaf-2ca8-4c8f-8eea-6a2e4a3e3835



https://github.com/user-attachments/assets/39adfa13-0cca-42ab-b5ae-669e243a2698



https://github.com/user-attachments/assets/dc594e21-6c51-48a6-8a59-ce6146ca84a4

#### Security & invariants


https://github.com/user-attachments/assets/f36b5535-3f2e-4ccc-a8a1-161c12bc0089



https://github.com/user-attachments/assets/694cf384-0e61-4eb2-b79d-3ac1db76b3d1



https://github.com/user-attachments/assets/6822b5b2-01c7-4842-aa45-befb698acc23



https://github.com/user-attachments/assets/6ca25462-8b80-45fd-b76f-d0d6e895dca5

#### Cold start


https://github.com/user-attachments/assets/f42024f9-27e5-4a72-a8f2-c18ee1f3f313



https://github.com/user-attachments/assets/0aedfd2b-1bf1-4cc7-b9c7-33543bb36222







## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.








[TRAM-3853]:
https://consensyssoftware.atlassian.net/browse/TRAM-3853?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[TRAM-3853]:
https://consensyssoftware.atlassian.net/browse/TRAM-3853?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches deep-link routing, buy eligibility gates, and cold-start
catalog/region resolution; regressions could mis-route users or block
valid buys, though coverage is extensive.
> 
> **Overview**
> **`/buy` deep links now open the in-app unified Buy flow** instead of
redirecting to Portfolio. The shared deep-link handler routes to a new
**`/ramps/buy-interstitial`** entry that parses link params into a buy
intent, preserves query params for any Portfolio fallback URL, and
delegates to the existing **`goToBuy`** gate (token selection vs
build-quote with pre-selection).
> 
> **`goToBuy` is extended** for this entry path: optional **`replace`**
history, **`portfolioRedirectUrl`** for migration users, on-demand
**countries/tokens** fetch on cold start before pre-select, and
**`resolveRampControllerToken`** for CAIP-19 casing and native
**`slip44:.`** placeholders. Background exposes **`getRampsCountries`**
through the ramps controller API.
> 
> Supporting changes include a new route constant, router wiring,
unit/e2e coverage for deep links and interstitial behavior, CODEOWNERS
for buy routes, and test fixtures that no longer treat **`/buy`** as an
external redirect (redirect examples moved to **`card-onboarding`**).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a02cfb8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@metamask-ci metamask-ci Bot mentioned this pull request Nov 13, 2026
10 of 18 tasks
@metamaskbot metamaskbot added the release-13.58.0 Issue or pull request that will be included in release 13.58.0 label Nov 16, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.58.0 on PR, as PR was added to branch 13.58.0 when release was cut.

This branch was successfully deployed

1 active and 1 inactive deployments
pr-comment — 6cc38b56 Deployed Oct 28, 2026 by wenfix via identify-codeowners #87742
segment-schema — 6cc38b56 Deployed Oct 28, 2026 by wenfix via propose #1354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.58.0 Issue or pull request that will be included in release 13.58.0 size-M team-money-movement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants