Skip to content

e710bc80 - Only reuse a personal IBAN whose bank still receives - #4501

Merged
TaprootFreak merged 1 commit into
developfrom
fix/viban-lookup-requires-receiving-bank
Jul 30, 2026
Merged

e710bc80 - Only reuse a personal IBAN whose bank still receives#4501
TaprootFreak merged 1 commit into
developfrom
fix/viban-lookup-requires-receiving-bank

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Incident

Since the EUR personal-IBAN change went to production, customers holding a retired Yapeal EUR
personal IBAN
cannot buy by bank transfer at all — they get PersonalIbanIssuanceFailed.

1'678 customers hold such a row.

Cause

getActiveForUserAndCurrency is a findOne with no ORDER BY and no check on whether the bank still
receives. A customer can hold several active rows for one currency — a Yapeal EUR IBAN from 2025 next
to a Frick EUR IBAN issued this week. The query can return the retired one; the caller then sees
virtualIban.bank.receive === false, skips the branch, and falls through.

Until yesterday that fall-through landed on the collection account and nobody noticed. Now the
collection account is deliberately gone, so the same path ends in a 400.

Confirmed on a real account: three active rows (Yapeal EUR receive=false, Yapeal CHF, Frick EUR
receive=true) — the working Frick row was never reached.

Fix

Filter the lookup on bank: { receive: true }. The working row is then found, or none is and issuance
proceeds normally — which is what should have happened for these customers all along.

Scope

One condition in one query, plus the test that pins it. No behaviour change for customers with a
single active IBAN.

getActiveForBuyAndCurrency has the same shape but is unreachable in production today
(asset.personalIbanEnabled and wallet.buySpecificIbanEnabled are off everywhere), so it is left
for the follow-up rather than widening a hotfix.

A customer can hold several active rows for one currency - a retired Yapeal
EUR IBAN next to a working Frick one. The lookup is a findOne without an
ORDER BY, so the retired row can win. The caller then sees an IBAN whose
bank does not receive, skips the branch, and since the collection account is
no longer a fallback the request ends in PersonalIbanIssuanceFailed.

1678 customers hold such a retired Yapeal EUR row and could not buy by
transfer. Filter the lookup on a receiving bank so the working row is found,
or none is and issuance proceeds.
@TaprootFreak
TaprootFreak marked this pull request as ready for review July 30, 2026 12:40
@TaprootFreak
TaprootFreak merged commit 94f3a59 into develop Jul 30, 2026
12 checks passed
@TaprootFreak
TaprootFreak deleted the fix/viban-lookup-requires-receiving-bank branch July 30, 2026 12:40
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