Skip to content

fix(wallet): hide unusable linked US banks and allow relinking - #75

Merged
MakelangelOO merged 2 commits into
developfrom
bqe-2657
Sep 30, 2026
Merged

MakelangelOO merged 2 commits into
developfrom
bqe-2657

Conversation

@MakelangelOO

@MakelangelOO MakelangelOO commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The wallet treated any linked US bank with an active Plaid link as usable, and showed failed links like any other product:

  • A bank with linkStatus: active but status: creation_in_progress could be picked as the ACH source, and the order would fail.
  • A pocket holding a bank that failed to link could never link a new one, because the one-bank-per-pocket rule counted the failed row.
  • Failed links showed on account pages with the generic label and the raw creation_failed status.

Linear: https://linear.app/bloque/issue/BQE-2657/wallet-no-debe-mostrar-cuentas-bancarias-vinculadas-que-no-estan

How it works

New src/domain/accounts/external-us-bank.ts defines the linked-bank states once:

  • usable: status: active and linkStatus: active
  • failed: status: creation_failed or linkStatus: link_failed
  • linking: status: creation_in_progress with linkStatus: active

Screens use these helpers instead of checking linkStatus alone.

Changes

  • useAccountPicker: requireLinkStatus replaced by requireUsableUsBank.
  • US bank topup:
    • The source bank is the pocket's usable bank, not its first bank row.
    • A pocket whose only bank failed can be linked again.
    • Polling continues until the new account is active or failed.
    • Once Plaid is done and the account is still activating, the screen shows an "activating" state: slower polling (10s), a check-again button and no link timeout. It shows the same state when the user's only bank is still activating.
    • A failed creation shows the failed step.
  • Account detail and account list hide failed banks. A bank still being activated shows "Linking in progress" instead of the raw status. The add-product menu offers Plaid again when the pocket's bank failed.
  • Unit tests for the new helpers.

Dev requirements

None. US rails are still behind US_RAILS_ENABLED = false, so only the account pages change visibly today.

Risk

  • Every relink attempt creates a new external-us-bank row in mediums. Keeping only one live row per ledger is backend work, tracked in BQE-2732.
  • The existing 5-minute link timeout still applies while Plaid is pending (abandoned sessions). The activation phase has no known upper bound, so it never times out and keeps polling while the screen is open.

A linked US bank only counts as an ACH source when both the account and
the Plaid link are active. Failed links are hidden from account lists and
no longer block linking a new bank to the same pocket.
@linear

linear Bot commented Sep 30, 2026

Copy link
Copy Markdown

BQE-2657

@MakelangelOO
MakelangelOO merged commit ae04e62 into develop Sep 30, 2026
2 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