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
[HOLD][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page #84015
Version Number: V9.3.28-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#81333 Email or phone of affected tester (no customers):dreamnitethedragon@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Redminote 10S Android 13 App Component: User Settings
Action Performed:
Launch app
Go to wallet
Make payments - united states - region bank
Complete the flow until "let's double check" page
Tap top arrow
Tap device back button
Expected Result:
Tapping device back button must direct user to previous page.
Actual Result:
Tapping top arrow navigates back to previous page and tapping device back button directs user to "where's your bank account located" page.
Please re-state the problem that we are trying to solve in this issue.
When a user is in the US bank account setup flow (Wallet → Add Bank Account → select US → choose Plaid/Manual → go through substeps until the "Let's double check" confirmation page), tapping the header back arrow correctly navigates to the previous substep, but pressing the device back button (Android hardware button or browser back) incorrectly jumps all the way back to the "Where's your bank account located?" country selection page, skipping all intermediate substeps.
What is the root cause of that problem?
The PersonalInfoPage component (PersonalInfo.tsx:24-96) manages its substeps (PlaidBankAccount/ManualBankAccount → LegalName → Address → PhoneNumber → Confirmation) using the deprecated useSubStep hook, which tracks the current step purely via React state (screenIndex) rather than pushing navigation routes.
The component defines a correct handleBackButtonPress function (lines 71-81) that decrements the substep index, but this handler is only connected to the header back arrow via InteractiveStepWrapper → HeaderWithBackButton.onBackButtonPress. There is no useAndroidBackButtonHandler call to intercept the hardware/browser back button.
When the device back button is pressed:
On Android: React Navigation's default goBack() fires (no BackHandler listener intercepts it), which pops the entire SETTINGS_ADD_US_BANK_ACCOUNT screen from the navigation stack
On Web (Chrome): The browser navigates back in its history, but since useSubStep doesn't push routes for substep changes, there are no history entries for the intermediate steps
In both cases, the user lands on the previous screen in the navigation stack — the country selection page.
For comparison, the non-US bank account flow (InternationalDepositAccountContent.tsx) correctly handles this by calling useAndroidBackButtonHandler(handleBackButtonPress) and using the newer useSubPage hook which pushes actual routes for each substep.
What changes do you think we should make in order to solve the problem?
Add useAndroidBackButtonHandler to PersonalInfoPage (PersonalInfo.tsx) to intercept the hardware/device back button, similar to how InternationalDepositAccountContent.tsx does it:
Import useAndroidBackButtonHandler from @hooks/useAndroidBackButtonHandler
Modify handleBackButtonPress to return a boolean (true to prevent default navigation behavior)
Call useAndroidBackButtonHandler(handleBackButtonPress) inside the component
This ensures the device back button calls the same logic as the header back arrow — decrementing the substep index instead of popping the entire screen.
Note: BankAccountPurposePage (index.tsx) has the same pattern (manages substeps via useState without BackHandler registration) and should also be fixed.
What alternative solutions did you explore? (Optional)
The longer-term solution would be to migrate PersonalInfoPage from the deprecated useSubStep hook to the newer useSubPage hook (per issue #79039), which uses actual navigation routes for each substep. This would make the back button work correctly by default since each substep would have its own entry in the navigation stack/browser history. However, adding useAndroidBackButtonHandler is the minimal fix that addresses the immediate bug.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Bank account - Tapping device back button directs user to "where's your bank account located" page[/-][+][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/+]on Mar 3, 2026
Please re-state the problem that we are trying to solve in this issue.
When a user is in the US bank account setup flow and reaches the "Let's double check" confirmation page (or any substep within PersonalInfo), tapping the device back button (Android hardware button or browser back gesture) incorrectly navigates all the way back to the "Where's your bank account located?" country selection page, skipping all intermediate substeps. However, tapping the header back arrow correctly navigates to the previous substep.
What is the root cause of that problem?
The PersonalInfo() function in PersonalInfo manages substeps (FullName → DateOfBirth → SocialSecurityNumber → Address → Confirmation) through local component state rather than pushing actual navigation routes. The component defines a handleBackButtonPress() function that correctly decrements the substep index, but this handler is only connected to the header back arrow via InteractiveStepWrapper's onBackButtonPress prop.
When the device back button is pressed, React Navigation's beforeRemove event fires, attempting to navigate away from the entire REIMBURSEMENT_ACCOUNT_ROOT screen. Since there's no custom handler intercepting this event, React Navigation's default behavior executes, which pops the entire screen from the navigation stack and returns to the previous screen (the country selection page). The substep state changes don't create navigation history entries, so the intermediate substeps are effectively invisible to the navigation system.
The codebase already has the useBeforeRemove hook pattern for handling this exact scenario (intercepting hardware back navigation to call custom handlers instead of default navigation behavior). This pattern just needs to be applied to PersonalInfo, BusinessInfo, BankInfo, and BeneficialOwnersStep — all components that use substeps within the ReimbursementAccount flow.
What changes do you think we should make in order to solve the problem?
Add the useBeforeRemove hook to intercept the device back button in PersonalInfo:
import{useCallback}from'react';importuseBeforeRemovefrom'@hooks/useBeforeRemove';functionPersonalInfo({onBackButtonPress, ref}: PersonalInfoProps){// ... existing code ...consthandleBackButtonPress=useCallback(()=>{if(isEditing){goToTheLastStep();return;}if(screenIndex===0){onBackButtonPress();}else{prevScreen();}},[isEditing,screenIndex,goToTheLastStep,onBackButtonPress,prevScreen]);// Intercept hardware back buttonuseBeforeRemove(useCallback((e)=>{// Only intercept if we're not on the first substepif(screenIndex===0&&!isEditing){return;}e.preventDefault();handleBackButtonPress();},[screenIndex,isEditing,handleBackButtonPress],),);// ... rest of code ...}
What alternative solutions did you explore? (Optional)
The existing proposal from MelvinBot suggests using useAndroidBackButtonHandler, which only works on Android. The useBeforeRemove hook is superior because it intercepts React Navigation's beforeRemove event, which fires for both Android hardware back buttons and browser back gestures on web, providing a cross-platform solution. This is the established pattern already used elsewhere in the codebase for handling back navigation in substep flows.
changed the title [-][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/-][+][HOLD][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/+]on Mar 10, 2026
Activity
melvin-bot commentedon Mar 3, 2026
Triggered auto assignment to @bfitzexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.MelvinBot commentedon Mar 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user is in the US bank account setup flow (Wallet → Add Bank Account → select US → choose Plaid/Manual → go through substeps until the "Let's double check" confirmation page), tapping the header back arrow correctly navigates to the previous substep, but pressing the device back button (Android hardware button or browser back) incorrectly jumps all the way back to the "Where's your bank account located?" country selection page, skipping all intermediate substeps.
What is the root cause of that problem?
The
PersonalInfoPagecomponent (PersonalInfo.tsx:24-96) manages its substeps (PlaidBankAccount/ManualBankAccount → LegalName → Address → PhoneNumber → Confirmation) using the deprecateduseSubStephook, which tracks the current step purely via React state (screenIndex) rather than pushing navigation routes.The component defines a correct
handleBackButtonPressfunction (lines 71-81) that decrements the substep index, but this handler is only connected to the header back arrow viaInteractiveStepWrapper→HeaderWithBackButton.onBackButtonPress. There is nouseAndroidBackButtonHandlercall to intercept the hardware/browser back button.When the device back button is pressed:
goBack()fires (noBackHandlerlistener intercepts it), which pops the entireSETTINGS_ADD_US_BANK_ACCOUNTscreen from the navigation stackuseSubStepdoesn't push routes for substep changes, there are no history entries for the intermediate stepsIn both cases, the user lands on the previous screen in the navigation stack — the country selection page.
For comparison, the non-US bank account flow (
InternationalDepositAccountContent.tsx) correctly handles this by callinguseAndroidBackButtonHandler(handleBackButtonPress)and using the neweruseSubPagehook which pushes actual routes for each substep.What changes do you think we should make in order to solve the problem?
Add
useAndroidBackButtonHandlertoPersonalInfoPage(PersonalInfo.tsx) to intercept the hardware/device back button, similar to howInternationalDepositAccountContent.tsxdoes it:useAndroidBackButtonHandlerfrom@hooks/useAndroidBackButtonHandlerhandleBackButtonPressto return a boolean (trueto prevent default navigation behavior)useAndroidBackButtonHandler(handleBackButtonPress)inside the componentThis ensures the device back button calls the same logic as the header back arrow — decrementing the substep index instead of popping the entire screen.
Note:
BankAccountPurposePage(index.tsx) has the same pattern (manages substeps viauseStatewithoutBackHandlerregistration) and should also be fixed.What alternative solutions did you explore? (Optional)
The longer-term solution would be to migrate
PersonalInfoPagefrom the deprecateduseSubStephook to the neweruseSubPagehook (per issue #79039), which uses actual navigation routes for each substep. This would make the back button work correctly by default since each substep would have its own entry in the navigation stack/browser history. However, addinguseAndroidBackButtonHandleris the minimal fix that addresses the immediate bug.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Mar 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (
External)[-]Bank account - Tapping device back button directs user to "where's your bank account located" page[/-][+][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/+]melvin-bot commentedon Mar 3, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022028777977730866149
twilight2294 commentedon Mar 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user is in the US bank account setup flow and reaches the "Let's double check" confirmation page (or any substep within PersonalInfo), tapping the device back button (Android hardware button or browser back gesture) incorrectly navigates all the way back to the "Where's your bank account located?" country selection page, skipping all intermediate substeps. However, tapping the header back arrow correctly navigates to the previous substep.
What is the root cause of that problem?
The
PersonalInfo()function in PersonalInfo manages substeps (FullName → DateOfBirth → SocialSecurityNumber → Address → Confirmation) through local component state rather than pushing actual navigation routes. The component defines ahandleBackButtonPress()function that correctly decrements the substep index, but this handler is only connected to the header back arrow viaInteractiveStepWrapper'sonBackButtonPressprop.When the device back button is pressed, React Navigation's
beforeRemoveevent fires, attempting to navigate away from the entireREIMBURSEMENT_ACCOUNT_ROOTscreen. Since there's no custom handler intercepting this event, React Navigation's default behavior executes, which pops the entire screen from the navigation stack and returns to the previous screen (the country selection page). The substep state changes don't create navigation history entries, so the intermediate substeps are effectively invisible to the navigation system.The codebase already has the
useBeforeRemovehook pattern for handling this exact scenario (intercepting hardware back navigation to call custom handlers instead of default navigation behavior). This pattern just needs to be applied to PersonalInfo, BusinessInfo, BankInfo, and BeneficialOwnersStep — all components that use substeps within the ReimbursementAccount flow.What changes do you think we should make in order to solve the problem?
Add the
useBeforeRemovehook to intercept the device back button in PersonalInfo:Apply the same fix to BusinessInfo, BankInfo, and BeneficialOwnersStep.
What alternative solutions did you explore? (Optional)
The existing proposal from MelvinBot suggests using
useAndroidBackButtonHandler, which only works on Android. TheuseBeforeRemovehook is superior because it intercepts React Navigation'sbeforeRemoveevent, which fires for both Android hardware back buttons and browser back gestures on web, providing a cross-platform solution. This is the established pattern already used elsewhere in the codebase for handling back navigation in substep flows.4 remaining items
arosiclair commentedon Mar 9, 2026
Not overdue
zscy0710 commentedon Mar 10, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In add-bank-account substeps, device/browser back should follow immediate previous step and not jump to earlier country-selection state.
What is the root cause of that problem?
Substep history handling can become inconsistent between header-back and device/browser-back interactions.
What changes did you make to solve the problem?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
[-][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/-][+][HOLD][$250] Bank account - Tapping device back button directs user to "where's your bank account located" page[/+]melvin-bot commentedon Mar 12, 2026
@arosiclair Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
bernhardoj commentedon Mar 13, 2026
@jponikarchuk can we retest this? Thanks!
arosiclair commentedon Mar 13, 2026
Requested a retest here
IuliiaHerets commentedon Mar 13, 2026
@arosiclair not repro on Web (Windows 10/Chrome) and Android (Galaxy A55 / Android 16), v9.3.37-0
repro.-.issue.84015.android.mp4
repro.-.issue.84015.1.mp4
arosiclair commentedon Mar 13, 2026
Thanks, closing this