Skip to content

feat(bank): fall back to manual entry when Plaid Link is blocked - #678

Merged
islandbitcoin merged 7 commits into
mainfrom
eng-manual-bank-entry-link
Aug 6, 2026
Merged

islandbitcoin merged 7 commits into
mainfrom
eng-manual-bank-entry-link

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Problem

Users adding a bank account via Plaid Link hit "rate limit exceeded" on the phone/OTP step inside the Plaid webview. Reported by two users on different numbers (+1404…, +1876…); a fresh number links fine, so it's a per-user/per-request Plaid-side limit — not an outage.

Crucially, that failure happens before any backend call (no public_token is ever produced), so:

  • The app just showed an alert and dead-ended the user.
  • The existing manual bank-details form was only reachable via the backend BRIDGE_PLAID_NOT_AVAILABLE fallback, which this in-webview case never triggers.

Bank linking is operated end-to-end by Bridge.xyz's Plaid account; there's no Flash-side knob for the limit. So the fix is to give blocked users a reliable way in.

Changes

  • usePlaidLink.onExit — on any real Plaid failure (rate limit, IP block, institution error), log the Plaid errorCode (the only place it's observable) and, when a manual fallback is wired, auto-navigate straight to the manual bank-details form with an explanatory toast, instead of a dead-end alert. Plain user-cancels stay silent (both iOS empty-error and Android no-error exit shapes).
  • Bank accounts screen — add an always-visible "Enter bank details manually" link under "Add bank account", so a user blocked inside the Plaid webview always has a path in.
  • Analytics — new logPlaidLinkFailure → plaid_link_failure event with error_code, to confirm the root cause (e.g. rate-limit vs institution vs IP pattern) across affected users.
  • Tests — extend use-plaid-link.spec.tsx for the new onExit contract: auto-navigate + toast, errorCode logging, UNKNOWN fallback when no code, silent cancel (no log/toast/nav).

Verification

  • use-plaid-link.spec.tsx: 18/18 pass
  • Full suite: 44 suites / 207 tests pass
  • tsc --noEmit: clean (rc=0); ESLint clean on changed lines

Follow-up (deferred)

Surface these failures in the #flash-activity Discord ops feed. Requires a new authed backend mutation on flash (plaidLinkReport → notifyOpsEvent), gated on the ops-feed work in flash PR #458 (not yet on main). Firebase logging covers confirmation in the meantime.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg

Dread and others added 7 commits July 25, 2026 12:36
Users adding a bank via Plaid Link can hit "rate limit exceeded" (and
other errors) inside the Plaid webview, on the phone/OTP step. That
failure never reaches the backend — no public_token is produced — so the
app previously just alerted and dead-ended the user. The manual bank
form already existed but was only reachable via the backend
BRIDGE_PLAID_NOT_AVAILABLE fallback, which this case never triggers.

Changes:
- usePlaidLink.onExit: on any real Plaid failure, log the Plaid errorCode
  (the only place it's observable) and, when a manual fallback is wired,
  auto-navigate straight to the manual bank-details form with an
  explanatory toast instead of a dead-end alert. Plain user-cancels stay
  silent (both iOS/Android exit shapes).
- Add an always-visible "Enter bank details manually" link on the Bank
  accounts screen, so a user blocked inside the Plaid webview always has
  a path in (not just the backend fallback).
- Add logPlaidLinkFailure analytics event (plaid_link_failure /
  error_code) to confirm the root cause across affected users.
- Extend use-plaid-link.spec.tsx to cover the new onExit contract
  (auto-navigate, logging, UNKNOWN errorCode fallback, silent cancel).

Follow-up (deferred): surface these failures in the #flash-activity
Discord ops feed. Requires a new authed backend mutation on flash
(plaidLinkReport -> notifyOpsEvent), gated on the ops-feed work in
flash PR #458. Firebase logging covers confirmation in the meantime.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
CI i18n-drift-check requires every key in raw-i18n/source/en.json to be
present in each raw-i18n/translations/<lang>.json. The two keys added in
this branch were only in en, failing the check. Add them to all 23 locale
files with the English string as the placeholder value (same convention as
the prior Plaid PR #668) — locales already fall back to en at runtime;
real translations follow in the usual batch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
# Conflicts:
#	app/i18n/raw-i18n/translations/af.json
#	app/i18n/raw-i18n/translations/ar.json
#	app/i18n/raw-i18n/translations/ca.json
#	app/i18n/raw-i18n/translations/cs.json
#	app/i18n/raw-i18n/translations/da.json
#	app/i18n/raw-i18n/translations/de.json
#	app/i18n/raw-i18n/translations/el.json
#	app/i18n/raw-i18n/translations/es.json
#	app/i18n/raw-i18n/translations/fr.json
#	app/i18n/raw-i18n/translations/hr.json
#	app/i18n/raw-i18n/translations/hu.json
#	app/i18n/raw-i18n/translations/hy.json
#	app/i18n/raw-i18n/translations/it.json
#	app/i18n/raw-i18n/translations/ms.json
#	app/i18n/raw-i18n/translations/nl.json
#	app/i18n/raw-i18n/translations/pt.json
#	app/i18n/raw-i18n/translations/qu.json
#	app/i18n/raw-i18n/translations/sr.json
#	app/i18n/raw-i18n/translations/sw.json
#	app/i18n/raw-i18n/translations/th.json
#	app/i18n/raw-i18n/translations/tr.json
#	app/i18n/raw-i18n/translations/vi.json
#	app/i18n/raw-i18n/translations/xh.json
Simon-review blocking fix. toastShow's union advertises "warning" but
GaloyToast's config registered only success + error — and
react-native-toast-message THROWS in render on an unregistered type,
which the root ErrorBoundary catches by unmounting the entire app. The
Plaid manual-entry rescue toast (and the pre-existing "Remove — coming
soon" path) would tear the app down to the ErrorScreen at the exact
moment it tried to help a rate-limited user.

- galoy-toast: register a warning renderer (BaseToast, amber accent)
- toast.ts: title by type (Warning, not "Success"; common.warning existed)
- bank-accounts-screen: restore the 24px bottom spacing when the
  kycApproved-gated manual-entry button is hidden (was 8px)
- new __tests__/components/galoy-toast.spec.tsx: all three types render
  through the REAL toast pipeline without tripping the error boundary,
  incl. the exact toastShow({type:"warning"}) call the Plaid fallback
  makes (the hook spec mocks this seam; now it's covered for real)

Merge of origin/main (previous commit) resolved the 23-locale i18n
conflict with the invite feature: locales taken from main + this
branch's two keys re-injected; drift check green.

tsc clean, lint-changed clean, full suite 246/246.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
The merge commit's `git add -A` picked up a local node_modules symlink —
.gitignore's `node_modules/` (trailing slash) matches directories, not
symlinks. CI checkout materialized it and `yarn install` died with
EEXIST mkdir node_modules across all jobs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
lint-changed flags no-inline-styles/no-color-literals on the new lines
(the sibling success/error presets are grandfathered pre-existing).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
The repo pins prettier 2.8.8, which formats nested ternary branches
flat; the v3-style extra indent tripped lint-changed (2x Delete `··`).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
@islandbitcoin
islandbitcoin merged commit f778816 into main Aug 6, 2026
10 checks passed
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