feat: first-time recipient alert on Send flow#28650
Conversation
|
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. |
|
@metamaskbot publish-preview |
…/github.com/MetaMask/metamask-mobile into vs/add-1st-time-interaction-alert-send-flow
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 cb4296d. Configure here.
|
@metamaskbot publish-preview |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes directly affect the send/transfer confirmation flow — specifically recipient validation and the alert/warning system before proceeding. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
This change aligns MetaMask Mobile’s Send flow with the extension by surfacing first-time recipient interaction and token contract warnings before the user continues to confirmation.
Reason: Users should be explicitly warned when sending to an address they have not interacted with on-chain before, and when the recipient looks like a token contract, so they can double-check the destination.
Solution:
checkFirstTimeInteractioninapp/util/transaction-controller/index.ts, usinggetAccountAddressRelationshipfrom the transaction-controller preview package so semantics match the extension.useFirstTimeInteractionSendAlert,useTokenContractSendAlert) and an aggregatoruseSendAlertsthat orders alerts (token contract first, then first-time interaction).SendAlertModalto accept multipleSendAlertitems with prev/next navigation (design-systemButtonIcon, no “N of M” counter) and per-step acknowledge labels where needed.Recipientto open the modal when there are unacknowledged alerts, reset acknowledgement when the recipient changes, and block Review / auto-advance while alert checks are pending.toAddressErrorAllowAcknowledgepath from address validation in favor of the dedicated alert pipeline; token-contract detection moved out ofvalidateHexAddressinto the alert hook.Changelog
CHANGELOG entry: Added Send flow warnings for first-time recipient interaction
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1016
Manual testing steps
Screenshots/Recordings
1st-alert-mobile.mp4
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the Send recipient step gating logic and adds new asynchronous alert checks (token contract lookup and first-time interaction API), which can affect when users can proceed and may introduce edge cases around pending/acknowledgement state.
Overview
Adds a new Send-flow alert pipeline (
useSendAlerts) that surfaces token contract and first-time recipient interaction warnings before proceeding to confirmation, backed by a newcheckFirstTimeInteractionutil that callsgetAccountAddressRelationship.Refactors
SendAlertModalto accept a list ofSendAlerts with prev/next navigation and per-alert acknowledge labels, and updatesRecipientto block Review/auto-advance while alert checks are pending and to require acknowledging any unacknowledged alerts.Removes the old
toAddressErrorAllowAcknowledge/token-contract detection from address validation (validateHexAddress/useToAddressValidation) and updates tests/locales accordingly.Reviewed by Cursor Bugbot for commit 45a6f81. Bugbot is set up for automated code reviews on this repo. Configure here.