Skip to content

feat(support): adopt support consent flow in SRPErrorScreen and SocialLoginErrorSheet - #33523

Merged
NicolasMassart merged 36 commits into
mainfrom
MCWP-684-support-consent-web3auth
Jul 27, 2026
Merged

feat(support): adopt support consent flow in SRPErrorScreen and SocialLoginErrorSheet#33523
NicolasMassart merged 36 commits into
mainfrom
MCWP-684-support-consent-web3auth

Conversation

@NicolasMassart

@NicolasMassart NicolasMassart commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adopts the support-consent mechanism introduced in #33424 (base branch MCWP-684-support-consent-core) in the "Contact support" flows of SRPErrorScreen and SocialLoginErrorSheet. Instead of opening the MetaMask support URL directly, both flows now route through the support consent sheet first, and only open the support URL after the user confirms (or rejects and falls back to the plain URL).

This PR is part of a stacked series on top of #33424. Its base will be retargeted to main once the core PR merges.

Changelog

CHANGELOG entry: null

(Behavior already described in the core PR, #33424.)

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-684

Manual testing steps

Feature: Support consent on wallet creation error flows

  Scenario: user taps Contact support on the SRP error screen
    Given the user is on the SRP error screen

    When the user taps "MetaMask Support"
    Then the support consent sheet is displayed first
    And confirming opens the MetaMask support URL

  Scenario: user taps Contact support on the social login error sheet
    Given the user is on the social login error sheet

    When the user taps "MetaMask Support"
    Then the support consent sheet is displayed first
    And confirming opens the MetaMask support URL

Screenshots/Recordings

N/A — logic-only change, no UI beyond the already-reviewed SupportConsentSheet from the core PR.

Before

N/A

After

N/A

Pre-merge author checklist

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 to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

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

Low Risk
Onboarding error UX only; behavior change is gating support behind an existing consent flow with no auth or data-handling changes.

Overview
Contact support on the SRP and social-login wallet creation error UIs no longer opens the support URL immediately. Both screens now call openSupportWithConsent from useSupportConsent, passing a callback that uses Linking.openURL and the existing AppConstants.REVIEW_PROMPT.SUPPORT base URL so the shared consent sheet runs first (per the core support-consent work).

Tests were updated to mock useSupportConsent, assert openSupportWithConsent is invoked with the opener and support URL, and add a small test that invoking the passed opener still calls Linking.openURL. Copy/retry-related tests were tightened with act and toBeOnTheScreen instead of waitFor where appropriate.

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

NicolasMassart and others added 8 commits July 16, 2026 15:50
Adds the support consent sheet, hook, util, route, and ownerless
call sites (Compliance context, ReviewModal, ErrorBoundary,
Homepage MoreSection) that team-owned PRs will stack on.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a real assertion inside the submit-feedback waitFor and restores
spies after each test, per flaky-test-detection bot suggestions on PR #33424.

Co-authored-by: Cursor <cursoragent@cursor.com>
The prior en.json checkout came from a stale branch and clobbered
translation keys added to main since, breaking unrelated unit tests
in CI. Re-applies only the support_consent strings on top of main's
current en.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
…et prop for support contact

This update modifies the ErrorBoundary component to eliminate the use of the useSupportConsent hook, which was causing issues when rendering at the root boundary outside of NavigationProvider. Instead, it now utilizes an openTicket prop to handle support contact actions. Additionally, the corresponding tests have been updated to reflect this change, ensuring that the new behavior is correctly validated.

The support URL handling in the navigateToSupportConsent function has also been adjusted to open the raw base URL without appending device details, aligning with user consent preferences.
…ions

Addresses Copilot review comments on PR #33424: OpenSupportUrl now
allows Promise<void> to match async openers like Linking.openURL, and
onConfirm/onReject await open() in a try/catch so a rejected opener
can't surface as an unhandled promise rejection.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lLoginErrorSheet

Co-authored-by: Cursor <cursoragent@cursor.com>
@NicolasMassart NicolasMassart self-assigned this Jul 20, 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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 20, 2026
@metamask-ci metamask-ci Bot added the team-mobile-platform Mobile Platform team label Jul 20, 2026
NicolasMassart and others added 17 commits July 21, 2026 13:37
…onsent tests to call-site wiring only

Mock useSupportConsent instead of re-simulating the consent sheet's
navigation/onConfirm/onReject internals, since those mechanics are
already exhaustively covered in the core support-consent PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
… with the consent sheet flow

Co-authored-by: Cursor cursoragent@cursor.com
…t flow

Lets call sites record their support opened analytics event when the user actually opens support (on consent confirm/reject), instead of when the consent sheet is merely shown.

Co-authored-by: Cursor cursoragent@cursor.com
Add a comment to the single opener-invoke test in SRPErrorScreen and SocialLoginErrorSheet clarifying it covers the call site's Linking.openURL wiring, not consent-sheet internals (already covered by core PR #33424).

Co-authored-by: Cursor <cursoragent@cursor.com>
…opens

Bugbot flagged that onOpenSupport fired synchronously on confirm/reject,
before the async open() call resolved, so analytics could record
"support opened" even when opening later failed. onOpenSupport is now
threaded into confirmSupportConsent/rejectSupportConsent and fired only
after open() succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (MCWP-684-support-consent-core@79174d2). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                        @@
##             MCWP-684-support-consent-core   #33523   +/-   ##
================================================================
  Coverage                                 ?   84.72%           
================================================================
  Files                                    ?     6206           
  Lines                                    ?   166577           
  Branches                                 ?    40717           
================================================================
  Hits                                     ?   141136           
  Misses                                   ?    15815           
  Partials                                 ?     9626           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from MCWP-684-support-consent-core to main July 23, 2026 18:01
@NicolasMassart
NicolasMassart marked this pull request as ready for review July 24, 2026 10:13
@NicolasMassart
NicolasMassart requested a review from a team as a code owner July 24, 2026 10:13
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jul 24, 2026
@github-actions github-actions Bot added risk:low AI analysis: low risk and removed risk:medium AI analysis: medium risk labels Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

✅ All previously detected unit test flakiness issues in this PR have been fixed.

View recent run history

This check is informational only and does not block merging.

@NicolasMassart NicolasMassart removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 24, 2026
NicolasMassart and others added 2 commits July 24, 2026 13:50
- SRPErrorScreen: replace fake-timer waitFor polling with synchronous assertions (J8)
- SocialLoginErrorSheet: wrap async press in act() and use jest.mocked (J1)

Co-authored-by: Cursor <cursoragent@cursor.com>
@NicolasMassart NicolasMassart moved this to Needs dev review in PR review queue Jul 24, 2026
NicolasMassart and others added 3 commits July 24, 2026 17:14
Wrap the Copy-button presses in SRPErrorScreen and the retry-tracking
press in SocialLoginErrorSheet in await act(async ...) so the async
state updates flush inside act, and assert with toBeOnTheScreen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added size-M and removed size-S labels Jul 24, 2026
Fixes J8: waitFor polls with real timers and conflicts with
jest.useFakeTimers(). The act-wrapped Copy press already flushes the
copied-state update, so assert directly instead of via waitFor.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeSeedlessOnboarding, SmokeAccounts
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies two wallet creation error screens:

  1. SRPErrorScreen.tsx: Error screen shown when SRP-based wallet creation fails. Changed to use useSupportConsent hook instead of directly calling Linking.openURL() for the support link. This affects the SRP onboarding error path.

  2. SocialLoginErrorSheet.tsx: Error sheet shown when social login (seedless onboarding) fails. Same change - replaces direct Linking.openURL() with openSupportWithConsent() from useSupportConsent hook.

  3. Test files: Unit test updates to mock useSupportConsent and verify the new behavior pattern.

Why these tags:

  • SmokeSeedlessOnboarding: SocialLoginErrorSheet is directly part of the seedless/social login onboarding error flow. The change modifies how the support link works in this error state.
  • SmokeAccounts: SRPErrorScreen is part of the SRP-based wallet creation error flow, which is covered under account creation/onboarding tests.

Risk assessment:

  • Low risk: Changes are confined to error screens (not happy paths)
  • The useSupportConsent hook is already used in multiple other components (MoreSection, EligibilityFailedModal, MoneyMoreSheet, ReviewModal), so it's a proven pattern
  • No core infrastructure, controllers, or navigation changes
  • No performance impact expected - this is a UI-only change in error states

No performance tests needed: These are error screen UI changes with no impact on app launch, login, onboarding performance metrics, or any measured performance flows.

Performance Test Selection:
The changes are confined to error screens in the wallet creation flow (SRPErrorScreen and SocialLoginErrorSheet). They only modify how the support URL is opened (adding a consent step via useSupportConsent hook). There is no impact on app launch time, login performance, onboarding flow performance metrics, or any other measured performance scenarios.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jul 25, 2026
@NicolasMassart
NicolasMassart added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 2fde612 Jul 27, 2026
195 checks passed
@NicolasMassart
NicolasMassart deleted the MCWP-684-support-consent-web3auth branch July 27, 2026 10:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:low AI analysis: low risk size-M team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants