Repository navigation
Reuse the active workspace when adding a bank account to pay an invoice as a business #97047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marcochavezf
merged 5 commits into
Expensify:main
from
wildan-m:wildan/92859-invoice-add-bank-account-duplicate-workspace
Jul 29, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5cd3f96
Reuse active admin workspace in invoice business pay add-bank-account…
wildan-m b87d70e
Merge remote-tracking branch 'upstream/main' into wildan/92859-invoic…
wildan-m d2665bc
Explain why currency must not gate workspace reuse
wildan-m 377881e
Add tests for invoice business add bank account workspace reuse
wildan-m 670c767
Merge remote-tracking branch 'upstream/main' into wildan/92859-invoic…
wildan-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the active admin workspace is EUR but the invoice and payer currency are USD—the exact scenario added to the regression test—this branch now opens bank setup for the EUR workspace. The non-USD setup fixes the account currency to
policy.outputCurrency(NonUSDVerifiedBankAccountFlowPage.tsxlines 74–76), whileSettlementButtononly offers accounts whosebankCurrencymatches the invoice currency viamatchesCurrency()(PaymentUtils.tslines 165–166). The newly created EUR account therefore never appears as a payment method for the USD invoice, leaving the payer unable to complete payment; reuse needs to route the workspace through a currency change first or otherwise preserve creation of a currency-compatible workspace.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified this in the app — the mechanism is real. With a EUR active workspace the reuse branch does enter the non-USD flow, so the new account's currency follows the workspace rather than the invoice.
It isn't a regression though. In that same state (payer local currency IDR, USD invoice, EUR active workspace),
maindoesn't reuse, so it creates a workspace in the payer's local currency — IDR — which isn't globally reimbursable and dead-ends on the "set your workspace currency to USD" screen. And it does that on every press, which is the duplicate-workspace bug being fixed here. Neither path produces a payable account in that scenario;mainjust also litters workspaces.mainonly lands on a compatible currency when the payer's local currency happens to match the invoice, since it comes fromlocalCurrencyCodeand is independent of the invoice currency. So bank-account currency vs invoice currency is a pre-existing gap rather than something this change introduces, and it's worth tracking separately — making reuse currency-aware here would mean reinstating the exact gate that causes the duplicates.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking this @wildan-m. What do you think about the specific case where the invoice and the payer’s payment currency are USD, while the active workspace is EUR?
I believe this may differ from the IDR scenario mentioned in your response. Could the resulting EUR bank account be filtered out when returning to the USD invoice? I’m not completely certain, so perhaps it would be worth verifying this exact scenario. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunovjk Yes, it'd be filtered —
matchesCurrencycomparesbankCurrencyagainst the invoice currency. Whether that's a regression turns on the payer'slocalCurrencyCoderather than their payment currency: if it's non-USD (what I tested)mainalso ends up unpayable and spawns a workspace per press, so only a USDlocalCurrencyCodefavoursmain— and that one I can't reproduce, since it's set at signup with no setting to change it.