Repository navigation
feat(bank): fall back to manual entry when Plaid Link is blocked - #678
Merged
Merged
Conversation
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
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_tokenis ever produced), so:BRIDGE_PLAID_NOT_AVAILABLEfallback, 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 PlaiderrorCode(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).logPlaidLinkFailure→plaid_link_failureevent witherror_code, to confirm the root cause (e.g. rate-limit vs institution vs IP pattern) across affected users.use-plaid-link.spec.tsxfor the newonExitcontract: auto-navigate + toast,errorCodelogging,UNKNOWNfallback when no code, silent cancel (no log/toast/nav).Verification
use-plaid-link.spec.tsx: 18/18 passtsc --noEmit: clean (rc=0); ESLint clean on changed linesFollow-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 onmain). Firebase logging covers confirmation in the meantime.🤖 Generated with Claude Code
https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg