feat: Increase MM Connect loading toast duration#30136
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes affect the dApp connection UX flow, specifically:
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: |
|




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
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
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
8000to10000ms.Updates
ConnectionRegistry.handleConnectDeeplinkto conditionally hide the loading toast: always hide on failure, hide on success only whensessionRequest.initialMessageis present (direct deeplink), and do not manually hide on successful QR flows (noinitialMessage) 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.