Skip to content

feat: Increase MM Connect loading toast duration#30136

Open
jiexi wants to merge 4 commits into
mainfrom
jl/update-mmc-toast-durations
Open

feat: Increase MM Connect loading toast duration#30136
jiexi wants to merge 4 commits into
mainfrom
jl/update-mmc-toast-durations

Conversation

@jiexi
Copy link
Copy Markdown
Member

@jiexi jiexi commented May 13, 2026

Description

Increases the loading toast duration for the MM Connect initial handshake flow. In particular, the loading toast is no longer explicitly dismissed when the handshake flow is missing an initialMessage, indicating it is a QR based flow and that the dapp will send an initial request separately. In regular deeplink (non-QR based) flows, the initialMessage is populated with the initial wallet_createSession request, and so there is very little delay between when the MWP handshake is completed and an approval is shown to the user. In the new QR based flow, the initialMessage is not populated (to reduce QR code density, making it easier to scan) and the wallet_createSession request comes from the desktop dapp after the MWP handshake is complete which leads to the potential for longer delay between when the user scans the QR code, opens the wallet, and finally sees the approval prompt for permissions.

Changelog

CHANGELOG entry: Make the MetaMask Connect loading toast display more accurately

Not sure if this really warrants a changelog though

Related issues

See: MetaMask/connect-monorepo#295

Manual testing steps

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

Before

After

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

For performance guidelines and tooling, see the Performance Guide.

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 user-visible connection-handshake UX and alters when loading notifications are dismissed based on initialMessage, which could leave toasts lingering if flow detection is wrong. Logic is localized to SDKConnectV2 connect-deeplink handling with added tests covering the new cases.

Overview
Increases the SDKConnectV2 connect "loading" toast autodismiss from 8000 to 10000 ms.

Updates ConnectionRegistry.handleConnectDeeplink to conditionally hide the loading toast: always hide on failure, hide on success only when sessionRequest.initialMessage is present (direct deeplink), and do not manually hide on successful QR flows (no initialMessage) so the toast persists until autodismiss. Adds/updates tests to cover the QR vs direct-deeplink dismissal behavior and ensure failures still dismiss the loading toast to avoid overlapping with error toasts.

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

@jiexi jiexi requested a review from a team as a code owner May 13, 2026 17:43
@metamaskbotv2 metamaskbotv2 Bot added the team-wallet-integrations Wallet Integrations team label May 13, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7e0393e. Configure here.

Comment thread app/core/SDKConnectV2/services/connection-registry.ts
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeNetworkExpansion, SmokeMultiChainAPI, SmokeNetworkAbstractions
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are in the SDKConnectV2 module, specifically:

  1. host-application-adapter.ts: Increased the autodismiss timeout for the connection loading notification from 8000ms to 10000ms. This is a minor UX timing change.

  2. connection-registry.ts: Added conditional logic for when to hide the loading toast based on whether the connection is a QR flow (no initialMessage) or a direct deeplink flow (with initialMessage). On failure, the toast is always dismissed. On success for QR flows, the toast is left to autodismiss naturally (since wallet_createSession arrives asynchronously). On success for direct deeplink flows, the toast is dismissed immediately.

These changes affect the dApp connection UX flow, specifically:

  • SmokeNetworkExpansion: Tests Solana/multi-chain dApp connect/disconnect flows, which go through the SDKConnectV2 connection registry
  • SmokeMultiChainAPI: Tests wallet_createSession (explicitly referenced in the code changes as the RPC sent by dApps in QR flows), session management, and CAIP-25 multi-chain sessions
  • SmokeNetworkAbstractions: Tests chain permission system for dApps and network selection

The changes are isolated to toast/notification timing and dismissal logic — no core connection logic is altered. Risk is medium because the loading toast behavior change could affect user experience during dApp connection flows, but the underlying connection mechanics are unchanged. No performance impact expected.

Performance Test Selection:
The changes only affect toast notification timing (autodismiss 8s→10s) and conditional dismissal logic for the loading toast. These are purely UX/behavioral changes with no impact on rendering performance, data loading, state management, or any other performance-sensitive areas.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M team-wallet-integrations Wallet Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants