Skip to content

fix(add-money): stop pushing Coinbase email verification twice#1096

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/coinbase-add-money-double-verification
Jul 17, 2026
Merged

fix(add-money): stop pushing Coinbase email verification twice#1096
bmc08gt merged 1 commit into
code/cashfrom
fix/coinbase-add-money-double-verification

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

The email verification screen is pushed twice when adding money via Coinbase / Google Pay.

Root cause

Picking Coinbase from the add-money deposit sheet emits one _selections value that two handlers act on, and both navigate to verification:

  1. InternalPurchaseMethodController.presentDepositOptions runs its own email/phone gate and returns AppRoute.Verification → navigate.
  2. SwapViewModel's persistent purchaseMethodController.selections collector — its Coinbase branch ran the email gate and dispatched OnVerificationNeeded (a second navigation) before bailing on the missing purchaseAmount.

The deposit-sheet selection is PaymentAction.Plain with no amount; the real purchase carries an amount. The collector was reacting to a selection it shouldn't handle — the same "shared controller also emits for the deposit sheet" trap the currency-creator already guards against.

Fix

  • SwapViewModel — move the purchaseAmount ?: return bail to the top of the Coinbase branch, before the email gate. The collector now ignores the amount-less deposit-sheet selection, leaving presentDepositOptions as the sole handler → one push.
  • InternalPurchaseMethodController — resolve the email the same way as CoinbaseOnRampController.resolveEmail() (verified email only when the flag is on, any entered email otherwise). The pre-emptive gate previously forced verification whenever the flag was on — even for an already-verified user — and disagreed with the purchase-time check.

The add-money deposit sheet's Coinbase selection was consumed by two
handlers that both navigated to verification: presentDepositOptions
(which runs its own email/phone gate) and SwapViewModel's persistent
purchaseMethodController.selections collector, whose Coinbase branch ran
the email gate and dispatched OnVerificationNeeded before bailing on the
missing purchase amount.

- SwapViewModel: bail on the missing amount before the email gate, so the
  collector ignores the amount-less deposit-sheet selection and leaves
  presentDepositOptions as the sole handler.
- InternalPurchaseMethodController: resolve the email the same way as
  CoinbaseOnRampController.resolveEmail() (verified email only when the
  flag is on, any entered email otherwise) so the pre-emptive gate agrees
  with the purchase-time check and doesn't verify an already-verified user.
@github-actions github-actions Bot added area: payments Payments, transfers, intents, billing area: tokens Token accounts, balances, token info type: fix Bug fix labels Jul 17, 2026
@bmc08gt
bmc08gt merged commit e3b8f0b into code/cash Jul 17, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/coinbase-add-money-double-verification branch July 17, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: payments Payments, transfers, intents, billing area: tokens Token accounts, balances, token info type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant