[pull] main from MetaMask:main#558
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
OTA was broken with old environment variables check. This PR aims to
solve that by introdocing a new environment variable.
<!--
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**
- [ ] 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.
## **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**
> Changes how several services choose API endpoints/environments by
switching from `GITHUB_ACTIONS`/`E2E` checks to a new
`BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY` flag, which could route
builds to different backend environments if misconfigured.
>
> **Overview**
> Introduces a new build-time env flag,
`BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY`, and uses it to decide when
to take **build-provided** URLs/environments (from `builds.yml`) versus
deriving them from `METAMASK_ENVIRONMENT`.
>
> Updates Baanx Card URL mapping, ramps SDK environment selection
(Aggregator + Deposit), ramps controller init, and rewards API URL
override logic to key off this flag, and refreshes/adjusts tests
accordingly (including removing the previous special-casing tied to
`E2E`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4249918. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
After some consideration, we are taking a step back and reverting the
built-in default feature flags for now.
We measured the pros and cons, and the benefits of standardising a
default value for feature flags were not enough to outweigh the cons,
such as the friction for teams to implement them.
<!--
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**
- [ ] 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.
## **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**
> Changes how remote feature flags are initialized and overridden by
removing build-time seeded defaults and re-enabling env-based overrides,
which could alter feature availability across builds/environments. Also
adjusts CI/build tooling and test behavior around `process.env`, so
regressions may surface as unexpected flag values in builds/tests.
>
> **Overview**
> Reverts the build-time seeding of LaunchDarkly defaults from
`builds.yml`: removes the `remote_feature_flags` section, stops
exporting `REMOTE_FEATURE_FLAG_DEFAULTS` in `apply-build-config.js`, and
drops related validation/verification checks.
>
> Simplifies remote feature flag controller init to use only persisted
state (removing the GitHub Actions/E2E-specific merge logic and its
tests), and updates selectors/tests to no longer treat `GITHUB_ACTIONS`
as “remote-only” (env overrides like `MM_EXTENSION_UX_PNA25` and
`MM_ADDITIONAL_NETWORK_BLACKLIST` now always apply when set). Test setup
is adjusted accordingly, including enabling env var inlining for some
selector files by removing them from `babel.config.tests.js` exclusions.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
170eef5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**
Introduces new lightweight toast notifications for Ramps orders behind
the `unifiedBuyV2` feature flag. When enabled, orders display modern
Toast-based notifications instead of the legacy
`NotificationManager.showSimpleNotification` approach.
The new toasts accept simple parameters (`orderId`, `cryptocurrency`,
`cryptoAmount`, `state`) rather than the full `FiatOrder` object,
keeping them decoupled from legacy aggregator/deposit code. This makes
them easy to maintain and eventually replace the old notifications
entirely.
**What changed:**
- Created `v2OrderToast.ts` utility with `buildV2OrderToastOptions` and
`showV2OrderToast` functions
- All four order states are covered: pending (with spinner + Track
button), completed (green checkmark), failed (red warning), cancelled
(orange warning)
- Icons use `AvatarSize.Lg` with transparent backgrounds and semantic
colors from design tokens
- Gated behind `selectRampsUnifiedBuyV2ActiveFlag` /
`useRampsUnifiedV2Enabled` - falls back to old notifications when flag
is off
- Updated three notification entry points: `processFiatOrder`,
`processCustomOrderId` (in `index.tsx`), `handleOrderCreated` (in
`Checkout.tsx`), and `useHandleNewOrder` (Deposit flow)
- Added translation strings under `ramps_v2.notifications`
## **Changelog**
CHANGELOG entry: Added new toast-style notifications for buy order
status updates (processing, completed, failed, cancelled) behind the
Unified Buy V2 feature flag
## **Related issues**
Refs: Unified Buy V2
## **Manual testing steps**
```gherkin
Feature: V2 Ramps Order Toast Notifications
Scenario: user sees processing toast when order is created (flag on)
Given the unifiedBuyV2 feature flag is enabled
And the user initiates a buy order
When the order is created
Then a toast notification appears with a spinner and "Processing your purchase of <crypto>"
And a "Track" button is visible
When user taps "Track"
Then the order details screen opens
Scenario: user sees success toast when order completes (flag on)
Given the unifiedBuyV2 feature flag is enabled
And the user has a pending buy order
When the order completes
Then a toast notification appears with a green checkmark and "Your purchase of <amount> <crypto> was successful!"
And the toast auto-dismisses after a few seconds
Scenario: user sees old notifications when flag is off
Given the unifiedBuyV2 feature flag is disabled
And the user initiates a buy order
When the order status changes
Then the legacy NotificationManager notification is shown
```
## **Screenshots/Recordings**
### **Before**
Legacy `NotificationManager.showSimpleNotification` banners
### **After**
New Toast notifications with semantic icon colors, and Track navigation
button
Aggregator:
https://github.com/user-attachments/assets/b52282ee-fbf0-4260-9e78-2f560a9f642d
Native:
https://github.com/user-attachments/assets/c1c6a6f1-0f2b-4c27-9409-0a757ecf4966
## **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.
## **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**
> Changes user-facing order status notifications in multiple Ramps entry
points (checkout, deposit, polling) and adds navigation from a toast
action; regressions could affect notification delivery/timing, though
behavior is gated and falls back to legacy notifications when disabled.
>
> **Overview**
> Adds new `v2OrderToast` utility to show Toast-based Ramps V2 order
status notifications (pending/completed/failed/cancelled), including a
pending-state *Track* action that navigates to
`Routes.RAMP.RAMPS_ORDER_DETAILS`.
>
> Updates the main order-notification emitters
(`Checkout.handleOrderCreated`, deposit `useHandleNewOrder`, and
`processFiatOrder`/`processCustomOrderId` in `Ramp/index.tsx`) to
conditionally use the new toasts when Unified Buy V2 is enabled,
otherwise keeping the existing
`NotificationManager.showSimpleNotification` behavior (some calls
deferred with `InteractionManager.runAfterInteractions`).
>
> Introduces a non-hook `isRampsUnifiedV2Enabled(state)` helper (with
tests) for thunk/plain-function contexts, extends test Babel config to
avoid inlining the related env var, and adds new `en.json` strings under
`ramps_v2.notifications`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7d84e5f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR contains UI updates for the Reveal SRP feature, specifically the Quiz Component and Reveal SRP views. Jira Link: https://consensyssoftware.atlassian.net/browse/TO-539 Figma Link: https://www.figma.com/design/pViOUcmjwhEzFsdrwknpNc/Onboarding-Redesign?node-id=19664-8777&m=dev <!-- 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: UI updates for the Reveal SRP feature, specifically the Quiz Component and Reveal SRP views. ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Reveal SRP UI Scenario: user copy srp. Given the app, create a wallet and go to settings, security to see the SRP. When user go to the settings, security Then Reveal SRP UI is updated with a new flow. Please validate using the above figma link ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> Settings Flow: https://github.com/user-attachments/assets/8860faf6-de09-4cdb-8fe6-505e18e41967 Account Details Flow: https://github.com/user-attachments/assets/32626c57-ec8c-4cb0-833c-ec8cbbc96361 ## **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. ## **Pre-merge reviewer checklist** - [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** > Changes the end-to-end Secret Recovery Phrase reveal flow (navigation, unlock/reveal behavior, clipboard/toast UX, and analytics), so regressions could block SRP access or alter security-sensitive handling despite being largely UI/refactor work. > > **Overview** > Refactors the Secret Recovery Phrase (SRP) reveal experience into a new `RevealPrivateCredential` flow that **starts with an intro + 2-step security quiz** and only then proceeds to the unlock/action screen, with support for skipping the quiz via a new `skipQuiz` param. > > Updates navigation to route SRP reveals (from settings, wallet details, and multichain account group details) directly to `Routes.SETTINGS.REVEAL_PRIVATE_CREDENTIAL`, adding `popToTopOnDone` for returning cleanly to wallet home when launched from wallet details. > > Redesigns the reveal UI: replaces the old modal/hold-to-reveal pattern with a header + ActionView, a banner-style warning, a tap-to-reveal blur overlay, a grid SRP display + QR tab, and switches “copied” feedback from Redux alert to a Toast (with copy throttling and Android API-level gating/fallback). Extensive unit/e2e tests and strings are updated to match the new flow and selectors/IDs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cda5d5f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…25890) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** * add METRICS_OPT_OUT analytics event for metrics opt-out flows. * Jira: https://consensyssoftware.atlassian.net/browse/TO-524 * Introduce `METRICS_OPT_OUT` analytics event. * Add it when: - The user unchecks **Basic usage** on the OptinMetrics onboarding screen. - The user turns off **Participate in MetaMetrics** in Security & Privacy (Settings) - The user turns off **Participate in MetaMetrics** in Onboarding Default Settings (Manage Default Settings). - Include `location` and `updated_after_onboarding` on every opt-out event. <!-- 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: ## **Manual testing steps** ```gherkin Feature: Metrics Opt Out analytics tracking Scenario: opt-out event fired when unchecking basic usage during onboarding Given user is on the OptinMetrics screen during onboarding And "Basic usage data collection" is checked When user unchecks "Basic usage data collection" Then METRICS_OPT_OUT event is fired with location="onboarding_metametrics" and updated_after_onboarding=false Scenario: opt-out event fired when turning off Participate in MetaMetrics in Settings Given user is in the app And user navigates to Settings → Security & Privacy And "Participate in MetaMetrics" toggle is ON When user turns off the "Participate in MetaMetrics" toggle And user confirms the opt-out alert Then METRICS_OPT_OUT event is fired with location="settings" and updated_after_onboarding=true ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="686" height="75" alt="Screenshot 2026-02-12 at 12 38 03 PM" src="https://github.com/user-attachments/assets/499db8a0-7380-4e10-b912-10b81382dfdd" /> <img width="684" height="71" alt="Screenshot 2026-02-12 at 12 38 56 PM" src="https://github.com/user-attachments/assets/4ef956e6-e22e-4f02-b27e-220f01fe6144" /> <!-- [screenshots/recordings] --> ## **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. ## **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] > **Low Risk** > Adds non-critical analytics tracking and test coverage; main risk is slightly altered event emission timing/volume when toggling metrics off. > > **Overview** > Adds a new analytics event, `MetaMetricsEvents.METRICS_OPT_OUT`, and emits it whenever users opt out of metrics during onboarding (`OptinMetrics` unchecking Basic usage) or later via the Security & Privacy MetaMetrics toggle. > > Also threads an `analyticsLocation` prop through `MetaMetricsAndDataCollectionSection` (used by onboarding default settings) so opt-out/opt-in events carry the correct `location`, and updates tests to assert the new event payloads and marketing auto-uncheck behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 21f9ec5. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description**
The perps connection error screen was firing \`PERPS_SCREEN_VIEWED\`
with \`screen_type: error\` but without enough breakdown to understand
what was failing or whether users were recovering. Error volume was
visible but not actionable — distinguishing error types required a
separate Sentry investigation each time.
This PR adds the missing context:
- **Remove \`captureException\` in
\`PerpsConnectionManager.connect()\`** — was duplicating Sentry events.
Replaced by \`Logger.error\` in the provider callers with
\`component:PerpsConnectionManager action:connection_connection\` tags,
so the existing Sentry filter keeps working
- **Sentry breadcrumb** in \`PerpsConnectionProvider\` when the error
screen renders — makes it visible in issue timelines
- **Enrich \`PERPS_SCREEN_VIEWED\`** with \`error_message\`,
\`screen_name: connection_error\`, and \`retry_attempts\`
- **Track Go back button** (\`action: connection_go_back\`) — first
abandonment signal for the error screen
- **Add \`error_message\` to retry tracking** — correlate which errors
users retry vs abandon
- **Update \`perps-sentry-reference.md\`** with the Sentry filter and
MixPanel event table for connection error monitoring
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
\`\`\`gherkin
Feature: Perps connection error observability
Scenario: user sees connection error screen
Given the app is open on the Perps tab
When the WebSocket connection fails
Then PERPS_SCREEN_VIEWED fires with screen_name: connection_error,
error_message, and retry_attempts
And a Sentry breadcrumb "PerpsConnectionErrorView shown" is recorded
Scenario: user taps retry on connection error screen
Given the connection error screen is shown
When user taps the retry button
Then PERPS_UI_INTERACTION fires with action: connection_retry and
error_message
Scenario: user taps go back on connection error screen
Given the connection error screen is shown
When user taps the go back button
Then PERPS_UI_INTERACTION fires with action: connection_go_back and
error_message
\`\`\`
## **Screenshots/Recordings**
### **Before**
N/A — observability only, no UI changes
### **After**
N/A — observability only, no UI changes
## **Pre-merge author checklist**
- [ ] 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.
## **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]
> **Low Risk**
> Observability-only changes (analytics, logging, breadcrumbs) with
minimal behavioral impact; primary risk is altered event
volume/semantics rather than runtime functionality.
>
> **Overview**
> Improves Perps connection-failure observability by enriching Mixpanel
and Sentry signals around the connection error screen and connection
lifecycle failures.
>
> `PerpsConnectionErrorView` now reliably tracks `PERPS_SCREEN_VIEWED`
via `useEffect` (keyed by `retryAttempts`) and includes `screen_name:
connection_error`, `error_message`, and `retry_attempts`; retry and new
*go back* interactions (`action: connection_go_back`) are tracked with
attempt counts and error message context.
>
> Sentry reporting is consolidated by removing `captureException` from
`PerpsConnectionManager.connect()` and instead emitting tagged
`Logger.error()` events from `PerpsConnectionProvider` (including
provider tag via new `PerpsConnectionManager.getActiveProviderName()`),
plus breadcrumbs when the error screen is shown and when retries fail to
reduce event noise; docs and tests are updated accordingly.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1716870. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cal Leung <cal.leung@consensys.net>
Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR adds analytics instrumentation to the wallet creation error screens introduced in PR #25564 Reason for the change: The SRPErrorScreen and SocialLoginErrorSheet error screens currently have no analytics tracking, making it impossible to measure how many users encounter wallet creation errors during onboarding or how they respond Solution: Added three new analytics events to MetaMetrics: * WALLET_CREATION_ERROR_SCREEN_VIEWED - Tracks when error screen is displayed * WALLET_CREATION_ERROR_RETRY_CLICKED - Tracks when user taps "Try Again" * WALLET_CREATION_ERROR_REPORT_SENT - Tracks when user sends error report (SRP only) Jira: https://consensyssoftware.atlassian.net/browse/TO-537 <!-- 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: ## **Manual testing steps** ```gherkin Feature: Wallet Creation Error Analytics Scenario: SRP error screen tracks screen viewed event Given user is on the Create Password screen during SRP onboarding When wallet creation fails Then user sees the SRP Error Screen And WALLET_CREATION_ERROR_SCREEN_VIEWED event is tracked with flow_type: 'srp' Scenario: SRP error screen tracks retry event Given user is on the SRP Error Screen When user taps "Try Again" button Then WALLET_CREATION_ERROR_RETRY_CLICKED event is tracked with flow_type: 'srp' And user is navigated back to onboarding Scenario: SRP error screen tracks report sent event Given user is on the SRP Error Screen When user taps "Send Error Report" button Then WALLET_CREATION_ERROR_REPORT_SENT event is tracked with flow_type: 'srp' And error is sent to Sentry And user is navigated back to onboarding with toast notification Scenario: Social Login error screen tracks screen viewed event Given user is on the Create Password screen during social login onboarding When wallet creation fails Then user sees the Social Login Error Sheet And WALLET_CREATION_ERROR_SCREEN_VIEWED event is tracked with flow_type: 'social_login' Scenario: Social Login error screen tracks retry event Given user is on the Social Login Error Sheet When user taps "Try Again" button Then WALLET_CREATION_ERROR_RETRY_CLICKED event is tracked with flow_type: 'social_login' And user is navigated back to onboarding ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="768" height="57" alt="Screenshot 2026-02-23 at 12 48 41 PM" src="https://github.com/user-attachments/assets/959c4438-96c9-4223-81f9-b8af14f505fe" /> <img width="775" height="92" alt="Screenshot 2026-02-23 at 12 54 11 PM" src="https://github.com/user-attachments/assets/979a5366-c44a-42d7-96bf-cd2acf55574f" /> <!-- [screenshots/recordings] --> ## **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. ## **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] > **Low Risk** > Adds analytics instrumentation and a Redux dispatch hookup with no changes to wallet creation behavior or security-sensitive logic. > > **Overview** > Adds a new MetaMetrics event, `WALLET_CREATION_ERROR_SCREEN_VIEWED`, and emits it when the wallet creation error UI is shown for both SRP and social-login onboarding flows. > > `SRPErrorScreen` is wired to Redux to persist the onboarding event via `trackOnboarding` when metrics are disabled, while `SocialLoginErrorSheet` tracks immediately via `useAnalytics`; both include `flow_type`, `error_name`, and `error_message` properties. Tests are updated to mock analytics and assert the event is fired with the expected properties on mount. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 782b8c5. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR fixes a Bridge/Swap performance and stability issue where opening the page could trigger repeated balance RPC calls, and where source balance updates could be delayed after token/network changes. Changes included: - Refactored `useLatestBalance` to use chain-specific effects (EVM vs non-EVM) to prevent cross-chain dependency retriggers. - Added token identity handling using `address + chainId` to correctly refresh when switching same-address tokens across networks (e.g. Mainnet ETH -> Linea ETH). - Added state update guard in `useLatestBalance` to avoid redundant rerenders when balance values are unchanged. - Reduced duplicate source-balance fetching in the Bridge view flow by reusing the already-fetched source atomic balance in quote request/quote data paths. - Removed source-balance fetching from `QuoteDetailsCard` and passed `hasInsufficientBalance` from `BridgeView` instead. - Improved perceived speed by passing cached `sourceToken.balance` into `useLatestBalance` so balance can render immediately while fresh RPC fetch runs in the background. ## **Changelog** CHANGELOG entry: Fixed an issue that could cause repeated Bridge RPC balance calls and improved how quickly source balances appear after token selection. ## **Related issues** Fixes: [25967](#25967) ## **Manual testing steps** ```gherkin Feature: Bridge balance and quote stability Scenario: user opens Bridge view without entering amount Given the user has source and destination tokens selected When user opens the Bridge view Then only initial balance fetches occur and no continuous RPC loop is observed Scenario: user switches source token across networks with same token address pattern Given source token is native ETH on Mainnet When user switches source token to native ETH on Linea Then source balance updates to the correct Linea balance Scenario: user requests quote and confirms UI behavior remains intact Given user enters a valid source amount and has valid token pair inputs When quote is fetched and Quote Details are shown Then insufficient-balance and gas-sponsored UI behavior remains correct Scenario: user refreshes an expired quote Given quote expired modal is open When user taps "Get new quote" Then a new quote request is triggered successfully ``` ## **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 - [ ] 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. ## **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** > Touches balance-fetching and quote request logic, so regressions could impact displayed balances, insufficient-funds checks, or quote refresh behavior across EVM/non-EVM networks. > > **Overview** > Prevents repeated balance RPC calls on the Bridge/Swap view by refactoring `useLatestBalance` to (1) track token identity as `address+chainId` (normalizing EVM casing/chain formats), (2) split EVM vs non-EVM fetch effects to avoid cross-dependency re-triggers, and (3) avoid state updates when the fetched balance is unchanged. > > Reduces duplicated balance fetching by reusing `latestSourceBalance.atomicBalance` from `BridgeView` in `useBridgeQuoteRequest`/`useBridgeQuoteData`, and by removing balance fetching from `QuoteDetailsCard` (now takes `hasInsufficientBalance` via props). Adds/updates tests to cover the new override path and token-identity behavior, including a regression test ensuring non-EVM token list changes don’t re-trigger EVM balance RPCs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0d42b8a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
- Removed usage of `Text` component inside `TagColored` - Added logic in `TagColored` to use received `testID` from `labelProps` <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** - Updates the usage of `TagColored` component for `Gas Sponsorship` feature, present inside #26252, by passing the text to be rendered directly inside the component. - Additioanlly uses the new `labelProps` property for `TagColored` implemented in #26362. - <!-- 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: ## **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** - [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 - [ ] 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. ## **Pre-merge reviewer checklist** - [X] 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** > Low risk UI refactor that changes how sponsored-fee badges render text and testIDs; main risk is minor visual/layout or test selector regressions across several screens. > > **Overview** > Refactors `TagColored` to respect `labelProps.testID` (defaulting to `TAGCOLORED_TEXT_TESTID`) and to merge label styles/props more predictably. > > Updates gas sponsorship / “No network fee” badges across Bridge, Network Selector, Network Multi Selector, custom networks, and confirmations to pass the label string directly to `TagColored` (instead of nesting a `Text`), using `labelProps` to control variant and styling. Several fixed-height container styles are removed/adjusted and the `NetworkSelector` snapshot is updated to reflect the new layout/testID behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 36c2bb3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Signed-off-by: gabrieledm <gabriele.delmonte@proton.me>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR establishes E2E test coverage for legacy evm MetaMask Connect flows within the React Native Playground app, ensuring the MetaMask Connect correctly manages simultaneous connections across multiple networks and that permissions, request routing, and session lifecycle all function end-to-end. <!-- 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/WAPI-1052 ## **Manual testing steps** ~~1. Pull https://github.com/MetaMask/connect-monorepo 2. `yarn && yarn build` 3. Run appropriate test dapp locally `integrations/wagmi` or `playground/legacy-evm-react-vite-playground` using `yarn dev --host`~~ 4. In the mobile repo, update `appwright/appwright.config.ts` for the `mm-connect-android-local` entry 5. You will need a prefined SRP android build. You can find one **[here](https://app.bitrise.io/build/2f2254fc-34bf-4291-bbb5-d525aa01d717?tab=artifacts)**. 6. Add entry for `E2E_PASSWORD` in `.js.env` and source it with `source .js.env`. You can get the password from someone in slack. 7. Determine which `appwright/tests/mm-connect/connection-*.spec.js` you want to run ~~8. Update the dapp url constant to use `10.0.2.2` for the host~~ 9. Ensure the other tests in the suite are marked `.skip` 10. Follow instructions in `tests/performance/mm-connect/README.md` (L#51 - L#105) to create APK for react native playground to be used in e2e test 11. `yarn appwright test --project mm-connect-android-local --config appwright/appwright.config.ts` ## **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** - [ ] 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. ## **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] > **Low Risk** > Test-only changes; main risk is increased CI runtime/flakiness due to added end-to-end app automation and new selectors. > > **Overview** > Adds a new RN-playground Appwright spec, `legacy-evm-rn-connect.spec.js`, that exercises the **Legacy EVM** MetaMask Connect flow end-to-end (connect, `personal_sign`, cancelled `eth_sendTransaction`, and `wallet_switchEthereumChain` verification). > > Extends `RNPlaygroundDapp` with Legacy EVM-specific selectors/actions/assertions (connect-legacy button, card fields, response text, and action buttons), and updates the performance/MM Connect READMEs to document the new test and RN playground APK requirements/commands. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e6b529e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Jiexi Luan <jiexiluan@gmail.com> Co-authored-by: Alex Donesky <adonesky@gmail.com>
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 : )