fix(money): wire Add mUSD entry + correct deposit toasts (MUSD-849, MUSD-845)#30741
Conversation
Selecting "Add your $X.XX mUSD" in the Money "Add money" sheet previously dismissed the modal with no further action. It now opens the moneyAccountDeposit confirmation with mUSD pre-selected as the "Pay with" token on the chain holding the user's largest mUSD balance. While the in-progress toast was being touched, splits its copy by entry-point intent: - Convert crypto → "Converting crypto" - Add mUSD → "Adding funds" Intent is tagged on the deposit batch at initiateDeposit() and read by the toast subscriber; it is cleared on every terminal status so the intent map cannot leak.
|
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. |
Extends the deposit toast intent split (added in the previous commit for the in-progress state) to success and failed states so the copy matches the Figma designs for the Convert and Add mUSD flows: - Convert success: "Conversion complete" / "$X added to Money account." - Convert failed: "Conversion failed" / "Unable to convert. Try again." - Add mUSD success: "Funds added" / "$X added to Money account." - Add mUSD failed: "Failed to add funds" / "Unable to add funds. Try again." Intent is read from the batch tag before the entry is cleared in the terminal state handlers, then forwarded into the success/failed toast builders.
|
…-849) When the user left a deposit confirmation screen without confirming (leaving a stale unapproved tx) and then opened the bottom sheet again, pressing Convert or Add mUSD did nothing. Two races stacked together: 1. initiateDeposit called navigateToConfirmation *after* an `await buildMoneyAccountDepositBatch(...)`, so by the time it ran the sheet animation had already completed and navigation.goBack had been dispatched. 2. The bottom-sheet handlers called initiateDeposit inside the sheet's post-close callback, which fires after goBack. By that point the sheet was unmounting, so useConfirmNavigation's "reject pending, queue navigation" branch lost its state to the unmount and the queued navigation never fired. Fix: - Move navigateToConfirmation before the await in initiateDeposit so the queue branch is entered synchronously. - Invert the order in handleConvertCrypto and handleMoveMusd: call initiateDeposit first, then close the sheet, so the sheet stays mounted long enough for the queued navigation to fire after the stale tx rejection propagates.
…ow (MUSD-849)" This reverts commit b7c2926.
Storing intent in the Map after addTransactionBatch resolved left a race window: the transaction's status events fire synchronously inside addTransactionBatch, so an immediate-failure path produced the "Conversion failed" toast even when the user pressed Add mUSD. Pre-generate the batchId via uuid + bytesToHex (mirroring how the controller generates one when not provided) and register intent in the Map synchronously before any await. Pass that same batchId to addTransactionBatch so the controller doesn't generate a different one. If addTransactionBatch throws without ever creating the tx, the dangling intent entry is removed in the catch branch.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
SmokeSwap is NOT selected because the changes don't touch swap-specific code paths — the Performance Test Selection: |
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 3317cbe. Configure here.
| }[]; | ||
| }; | ||
|
|
||
| export type DepositIntent = 'convert' | 'addMusd'; |
There was a problem hiding this comment.
Duplicate intent type defined in two files
Low Severity
DepositIntent in useMoneyToasts.tsx and MoneyAccountDepositIntent in useMoneyAccount.ts are identical 'convert' | 'addMusd' union types defined independently. If a new variant is added to one but not the other, intent values could silently mismatch across the toast and account layers. One definition that the other imports would eliminate this drift risk.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3317cbe. Configure here.





Description
Covers two related tickets:
Intent is registered on the deposit batch synchronously in
initiateDeposit()(the batchId is pre-generated client-side via the sameuuid → bytesToHexrecipe the transaction-controller uses internally), so the toast subscriber can resolve it even when a controller status event fires synchronously on an immediate-failure path. Entries are cleared on every terminal status (success / failed / dropped / cancelled / rejected) and on initiation throw.Changelog
CHANGELOG entry: Fixed the "Add mUSD" option in the Money account "Add money" sheet so it opens the deposit flow with mUSD pre-selected, and corrected the in-progress / success / failed toast copy for both the Convert and Add flows.
Related issues
Fixes: MUSD-849, MUSD-845
Manual testing steps
Screenshots/Recordings
Before
Tapping "Add your $X.XX mUSD" dismissed the bottom sheet with no further action. Deposit toasts used the generic "Transaction in progress / complete / failed" copy.
After
Tapping "Add your $X.XX mUSD" opens the deposit confirmation with mUSD pre-selected as "Pay with". Toast copy reflects the user's entry-point intent for the full lifecycle.
Simulator.Screen.Recording.-.iPhone.17.-.2026-05-28.at.15.34.18.mov
Pre-merge author checklist
Performance checks (if applicable)
For performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes money deposit initiation, confirmation pre-selection, and transaction toast behavior; risk is moderated by tests and scoped to deposit UX, but incorrect chain/token or intent handling could mislead users during fund movement.
Overview
The Add your $X mUSD row in the Money Add money sheet now starts the same money-account deposit flow as Convert crypto, instead of only closing the sheet. It passes
intent: 'addMusd'and apreferredPaymentTokenfor mUSD on the chain with the largest per-chain balance (default chain when balances are missing).initiateDepositaccepts optional intent and preferred payment token, pre-generates abatchId, registers intent in memory before submitting the batch, forwards the token into confirmation navigation, and clears intent on batch failure or terminal transaction status. The deposit confirmation screen passes that token intoCustomAmountInfoas the pre-selected Pay with asset.Deposit toasts (in progress, success, failed) now use separate copy for convert vs add mUSD, resolved from batch intent in
useMoneyTransactionStatus, with new locale strings.Reviewed by Cursor Bugbot for commit 3317cbe. Bugbot is set up for automated code reviews on this repo. Configure here.