You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bank Account - Click device back on success modal direct to Add BA flow and unable to continue #90144
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
PR #88193 introduced a new screen-based navigation architecture for the USD bank account flow that reintroduced this back-navigation bug. Reverting it will restore the previous single-screen state-machine approach that handled back navigation correctly.
The bug report describes: after completing the Add Bank Account flow and reaching the "You're all set" success modal, pressing the device back button (hardware back or swipe gesture) navigates the user back into the Add BA flow instead of closing the modal.
PR [CP Staging] Fix navigation problems in USD BA flow #87624 previously fixed this exact same symptom ("Success modal back button navigates to previous step instead of closing RHP") by changing onBackButtonPress={onBackButtonPress} to onBackButtonPress={() => Navigation.dismissModal()} in ConnectBankAccount.tsx.
PR feat: 79048 restore reverted usd flow #88193 (merged May 7, 2026) "restores the previously reverted USD flow refactor" and replaced the old single-screen USDVerifiedBankAccountFlow component with a new USDVerifiedBankAccountFlowPage that uses separate navigation screens for each step.
PR feat: 79048 restore reverted usd flow #88193 was merged on May 7, 2026. The issue version is 9.3.69-0, which is consistent with this being a staging-only regression introduced after v9.3.68.
Root Cause
The old USDVerifiedBankAccountFlow rendered all flow steps as different render states of a single screen using an in-memory step state variable (USDBankAccountStep). Because only one screen entry was ever pushed to the navigation stack, pressing the device hardware/swipe back button would pop the entire modal.
PR #88193 replaced this with USDVerifiedBankAccountFlowPage, where each step navigates to ROUTES.BANK_ACCOUNT_USD_SETUP with different page URL params. This pushes separate entries into the React Navigation stack for every step. When the user reaches the final "You're all set" success screen (ConnectBankAccount with bankAccountState === OPEN) and presses the device back button, the navigator pops to the previous stack entry — the ACH_CONTRACT / CompleteVerification step — instead of dismissing the modal.
The header back button correctly calls Navigation.dismissModal() because ConnectBankAccount.tsx overrides the onBackButtonPress prop for the OPEN state. However, the device/swipe back bypasses this override entirely and uses the navigator's native stack pop behavior.
Each step in the USD bank account setup flow calls Navigation.navigate() which gets converted to a PUSH action (because the route is not registered as a dynamic route). By the time the user reaches the success screen, ~8 screens have accumulated on the RHP navigation stack.
The in-app back button on the success screen correctly calls Navigation.dismissModal(), which pops the entire RHP. However, the browser/device back button bypasses this — it simply pops one entry from the navigation stack, returning the user to the previous flow step (CompleteVerification/ACH Contract) instead of dismissing the flow. Since the bank account is already in OPEN state, re-submitting from that step causes an error.
What changes do you think we should make in order to solve the problem?
In USDVerifiedBankAccountFlowPage.tsx, pass {forceReplace: true} (or equivalent) to Navigation.navigate() in the onSubmit callback so each step replaces the current screen instead of pushing a new one. This keeps only one USD setup screen on the RHP stack at any time, so the browser/device back button exits the entire flow rather than stepping backwards through completed steps.
What alternative solutions did you explore?
Intercept the hardware/browser back button on the success screen (via BackHandler or a navigation listener) to call dismissModal(). This is more of a patch — it only fixes the success screen but doesn't address the fact that the back button is broken during the entire flow (going back to already-submitted steps is generally undesirable).
Pop all intermediate screens when the success screen renders. More complex and could cause visual flicker.
The replace approach is cleanest since it addresses the core issue: multi-step wizard flows shouldn't accumulate browser history entries for each step.
The route bank-account/new/us/:page?/:subPage?/:action? is not in DYNAMIC_ROUTES, so linkTo converts NAVIGATE → PUSH.
The flow has 8 pages: Country, BankAccount, Requestor, VerifyIdentity, Company, BeneficialOwners, ACHContract, Validation.
Success screen at ConnectBankAccount.tsx:53-69 handles in-app back correctly but has no BackHandler for device/browser back.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
@arosiclair
I've had multiple attempts but none of the worked properly because you cannot reliably alter the window.location.history on web. However today I've realised that we've been looking at it from the wrong angle. I believe the expected result is wrong.
I think the real problem is that the re-submitting isnt working and not that we allow user to go back.
Ive checked how for example we act when adding personal BA from wallet and it turns out that it behaves the same but it's not failing when resubmitting
back.mp4
Ive checked why is resubmitting actually failing in our case and it turns out that after going back one of the checkboxes is being sent empty despite being checked.
I believe proper fix for this bug would be to sort out resubmitting.
Let me know whether my thinking is correct and the expected result is indeed incorrect here
Activity
melvin-bot commentedon May 11, 2026
Triggered auto assignment to @lakchote (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon May 11, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 11, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon May 11, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #88193 - "feat: 79048 restore reverted usd flow" by @MrMuzyk (High confidence)
Related Issues: #79048, #87658
Recommendation: REVERT
PR #88193 introduced a new screen-based navigation architecture for the USD bank account flow that reintroduced this back-navigation bug. Reverting it will restore the previous single-screen state-machine approach that handled back navigation correctly.
Assigned: @MrMuzyk (PR author), @dukenv0307 (approving reviewer), @arosiclair (approving reviewer)
Labels:
DeployBlockerCashkept (frontend bug in App repo). No label changes made.Details
Evidence
onBackButtonPress={onBackButtonPress}toonBackButtonPress={() => Navigation.dismissModal()}inConnectBankAccount.tsx.USDVerifiedBankAccountFlowcomponent with a newUSDVerifiedBankAccountFlowPagethat uses separate navigation screens for each step.Verification
src/pages/ReimbursementAccount/USD/ConnectBankAccount/ConnectBankAccount.tsx,src/pages/ReimbursementAccount/USD/USDVerifiedBankAccountFlowPage.tsxRoot Cause
The old
USDVerifiedBankAccountFlowrendered all flow steps as different render states of a single screen using an in-memory step state variable (USDBankAccountStep). Because only one screen entry was ever pushed to the navigation stack, pressing the device hardware/swipe back button would pop the entire modal.PR #88193 replaced this with
USDVerifiedBankAccountFlowPage, where each step navigates toROUTES.BANK_ACCOUNT_USD_SETUPwith differentpageURL params. This pushes separate entries into the React Navigation stack for every step. When the user reaches the final "You're all set" success screen (ConnectBankAccountwithbankAccountState === OPEN) and presses the device back button, the navigator pops to the previous stack entry — the ACH_CONTRACT /CompleteVerificationstep — instead of dismissing the modal.The header back button correctly calls
Navigation.dismissModal()becauseConnectBankAccount.tsxoverrides theonBackButtonPressprop for theOPENstate. However, the device/swipe back bypasses this override entirely and uses the navigator's native stack pop behavior.MrMuzyk commentedon May 11, 2026
Working on a fix
MelvinBot commentedon May 11, 2026
Proposal
What is the root cause of that problem?
Each step in the USD bank account setup flow calls
Navigation.navigate()which gets converted to a PUSH action (because the route is not registered as a dynamic route). By the time the user reaches the success screen, ~8 screens have accumulated on the RHP navigation stack.The in-app back button on the success screen correctly calls
Navigation.dismissModal(), which pops the entire RHP. However, the browser/device back button bypasses this — it simply pops one entry from the navigation stack, returning the user to the previous flow step (CompleteVerification/ACH Contract) instead of dismissing the flow. Since the bank account is already inOPENstate, re-submitting from that step causes an error.What changes do you think we should make in order to solve the problem?
In
USDVerifiedBankAccountFlowPage.tsx, pass{forceReplace: true}(or equivalent) toNavigation.navigate()in theonSubmitcallback so each step replaces the current screen instead of pushing a new one. This keeps only one USD setup screen on the RHP stack at any time, so the browser/device back button exits the entire flow rather than stepping backwards through completed steps.What alternative solutions did you explore?
Intercept the hardware/browser back button on the success screen (via
BackHandleror a navigation listener) to calldismissModal(). This is more of a patch — it only fixes the success screen but doesn't address the fact that the back button is broken during the entire flow (going back to already-submitted steps is generally undesirable).Pop all intermediate screens when the success screen renders. More complex and could cause visual flicker.
The replace approach is cleanest since it addresses the core issue: multi-step wizard flows shouldn't accumulate browser history entries for each step.
Investigation details
USDVerifiedBankAccountFlowPage.tsx:92-103— each step callsNavigation.navigate(ROUTES.BANK_ACCOUNT_USD_SETUP.getRoute(...)).bank-account/new/us/:page?/:subPage?/:action?is not inDYNAMIC_ROUTES, solinkToconverts NAVIGATE → PUSH.ConnectBankAccount.tsx:53-69handles in-app back correctly but has noBackHandlerfor device/browser back.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.arosiclair commentedon May 11, 2026
Revert was merged and CP'd. Asking for retest here.
m-natarajan commentedon May 11, 2026
Passed, Chrome / v9.3.69-14 (Waiting for validation on mWeb and Native apps)
REC-20260511203436.mp4
m-natarajan commentedon May 11, 2026
Unable to reproduce in mWeb (iPhone/chrome) and iPhone 13, v 9.3.69-15
WhatsApp.Video.2026-05-11.at.5.08.32.PM.mp4
WhatsApp.Video.2026-05-11.at.5.08.33.PM.mp4
Beamanator commentedon May 11, 2026
Perfect!
MrMuzyk commentedon May 13, 2026
@arosiclair
I've had multiple attempts but none of the worked properly because you cannot reliably alter the window.location.history on web. However today I've realised that we've been looking at it from the wrong angle. I believe the expected result is wrong.
I think the real problem is that the re-submitting isnt working and not that we allow user to go back.
Ive checked how for example we act when adding personal BA from wallet and it turns out that it behaves the same but it's not failing when resubmitting
back.mp4
Ive checked why is resubmitting actually failing in our case and it turns out that after going back one of the checkboxes is being sent empty despite being checked.
I believe proper fix for this bug would be to sort out resubmitting.
Let me know whether my thinking is correct and the expected result is indeed incorrect here
arosiclair commentedon May 13, 2026
Ah okay I see what you mean. I agree if we can fix resubmitting, then it's fine to navigate back from the confirmation page.
melvin-bot commentedon May 30, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.