Skip to content

fix(deposit-accounts): show Bridge setup before opening an account - #4069

Closed
innolope-dev wants to merge 1 commit into
mainfrom
innolope/bridge-account-setup-hotfix
Closed

innolope-dev wants to merge 1 commit into
mainfrom
innolope/bridge-account-setup-hotfix

Conversation

@innolope-dev

Copy link
Copy Markdown
Collaborator

A user could finish identity verification, tap to open a SEPA account, and hit a refusal while the requested Bridge rail was still setting up. Refresh the user capability when the account preview or claim reports setup in progress. This lets the existing Bridge terms prompt surface and keeps the selected currency pending until it can be opened.

This hotfix contains the account setup hook and its regression tests. The Add Money picker, analytics, card, and signup changes are tracked in #4065 for dev.

All 38 focused deposit account tests and the configured commit gate passed. The release captain should confirm API #2110 is live before merging this PR. The same UI fix is included in the #4065 dev port.

@innolope-dev innolope-dev self-assigned this Nov 12, 2026
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Nov 12, 2026 7:32am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 11163.31 → 11163.4 (+0.09)
Findings: 0 net (+2 new, -2 resolved)

🆕 New findings (2)

  • medium high-mdd — src/features/deposit-accounts/useDepositAccounts.ts:124 — useDepositAccounts: MDD 85.6 (uses across many lines from declarations)
  • medium high-dlt — src/features/deposit-accounts/useDepositAccounts.ts:124 — useDepositAccounts: DLT 40 (calls 40 distinct functions — high context load)

✅ Resolved (2)

  • src/features/deposit-accounts/useDepositAccounts.ts:123 — useDepositAccounts: MDD 81.7 (uses across many lines from declarations)
  • src/features/deposit-accounts/useDepositAccounts.ts:123 — useDepositAccounts: DLT 39 (calls 39 distinct functions — high context load)

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • ✅ unit: 19486 ran, 0 failed, 0 skipped, 6.4m

📊 Coverage (unit)

metric %
statements 87.7%
branches 80.5%
functions 81.8%
lines 89.2%
⏱ 10 slowest test cases
time test
🐢 15.5s scripts/__tests__/screens-adapter.test.js › runs the existing synthetic screen adapter Node acceptance suite
🐢 9.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Network failure keeps loading while retries remain, then shows the generic error
4.5s scripts/__tests__/indexable-urls.test.ts › excludes missing locale files, drafts, redirects, and retired pages from crawl and submission lists
4.4s scripts/__tests__/signup-attribution-paths.test.ts › includes newly published articles and locale fallbacks without editing the manifest
4.0s src/features/setup/__tests__/useSignupPasskey.test.tsx › opens the help drawer for NotReadableError and retries from it with one more ceremony
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_USER_NOT_PROVISIONED fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › routes the KYC rejection on its wire code, and does not retry it
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_VOLUME_NEAR_CAP fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_RECENT_REFUND fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › User KYC not approved fails fast with copy that names the real cause
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Chip review — no blocking findings — this is not an approval

One stale-capability recovery gap remains in the Bridge review flow.

Findings

  • MAJOR · src/features/deposit-accounts/useDepositAccounts.ts:341 · Retry the capability refresh while a review action is withheld
    If the accounts preview reports review-action while the cached capability still says ready (or needs-enrollment), this effect makes just one [USER] refresh. A 429 on that request is not retried, and review-action does not poll the accounts query; with the screen left open, the gate stays pending and the user never gets the Bridge terms action. Keep refreshing the capability with a bounded retry while this mismatch persists, or arrange a retry on subsequent preview updates.

  • MAJOR · src/features/deposit-accounts/useDepositAccounts.ts:319 · Copy now wrong: Review-action corridor's wait drawer says nothing is needed from the user
    After this change: When a corridor's review waits on the user (cause review-action) and the cached gate reads ready or needs-enrollment, the gate is now forced to pending, so the drawer shows the wait copy with no button.

These places still say otherwise:

  • pr:src/i18n/app/messages/en.json:5196 — "Nothing for you to do. This page updates by itself." → Your review is waiting on you. Check this account again in a moment to see the next step.
  • pr:src/i18n/app/messages/es-419.json:5196 — "No tienes que hacer nada. Esta pantalla se actualiza sola." → Tu revisión espera algo de ti. Vuelve a revisar esta cuenta en un momento para ver el siguiente paso.
  • pr:src/i18n/app/messages/es-AR.json:2242 — "No tenés que hacer nada. Esta pantalla se actualiza sola." → Tu revisión espera algo de tu parte. Volvé a revisar esta cuenta en un momento para ver el siguiente paso.
  • pr:src/i18n/app/messages/pt-BR.json:5196 — "Você não precisa fazer nada. Esta tela se atualiza sozinha." → Sua revisão depende de você. Confira esta conta de novo em instantes para ver o próximo passo.

Fix them in this pull request, or say where the fix goes. mono: copy ships to mono main as its own content change, never inside a code PR.

Checked clean

  • Pinned head and exact base diff; PR metadata and CI at this head (unit, typecheck, CodeQL passed; review and visual checks still in progress).
  • Capability gate, account-preview, claim, and user-query refresh paths; design-system row guidance.

Security review: did not run — this change has no security, privacy or money surface, so it was not asked. This review is one reviewer short.

Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

Copy check by claude-haiku-5-5: 1 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.

Exact head: 2b9f1e175d62 · Context: repo, design, api · Took 2m

useEffect(() => {
// A withheld corridor cannot be tapped through to a claim. Fetch its
// missing action even when the user never presses the claim button.
if (enabled && userId && staleReviewAction) void queryClient.invalidateQueries({ queryKey: [USER] })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR: Retry the capability refresh while a review action is withheld

If the accounts preview reports review-action while the cached capability still says ready (or needs-enrollment), this effect makes just one [USER] refresh. A 429 on that request is not retried, and review-action does not poll the accounts query; with the screen left open, the gate stays pending and the user never gets the Bridge terms action. Keep refreshing the capability with a bounded retry while this mismatch persists, or arrange a retry on subsequent preview updates.

for (const corridor of DEPOSIT_RAIL_ORDER) {
const gate = gateFor('deposit', { railId: railIdFor(corridor) })
const cause = unavailable[corridor]?.cause
const setupUnderWay = cause === 'setup-pending' || cause === 'review-pending' || cause === 'review-action'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR: Copy now wrong: Review-action corridor's wait drawer says nothing is needed from the user

After this change: When a corridor's review waits on the user (cause review-action) and the cached gate reads ready or needs-enrollment, the gate is now forced to pending, so the drawer shows the wait copy with no button.

These places still say otherwise:

  • pr:src/i18n/app/messages/en.json:5196 — "Nothing for you to do. This page updates by itself." → Your review is waiting on you. Check this account again in a moment to see the next step.
  • pr:src/i18n/app/messages/es-419.json:5196 — "No tienes que hacer nada. Esta pantalla se actualiza sola." → Tu revisión espera algo de ti. Vuelve a revisar esta cuenta en un momento para ver el siguiente paso.
  • pr:src/i18n/app/messages/es-AR.json:2242 — "No tenés que hacer nada. Esta pantalla se actualiza sola." → Tu revisión espera algo de tu parte. Volvé a revisar esta cuenta en un momento para ver el siguiente paso.
  • pr:src/i18n/app/messages/pt-BR.json:5196 — "Você não precisa fazer nada. Esta tela se atualiza sozinha." → Sua revisão depende de você. Confira esta conta de novo em instantes para ver o próximo passo.

Fix them in this pull request, or say where the fix goes. mono: copy ships to mono main as its own content change, never inside a code PR.

@innolope-dev

Copy link
Copy Markdown
Collaborator Author

Replaced by #4083.

This branch was successfully deployed

1 active and 1 inactive deployments
content-publish — 2b9f1e17 Deployed Nov 12, 2026 by innolope-dev via approve-and-merge #7926
Preview — 2b9f1e17 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant