Skip to content

Expensify Card - Device back button on confirm page does not return to 4th step after editing #80405

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.8-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78266
Email or phone of affected tester (no customers): applausetester+snjoidnjios@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • User is assigned a physical Expensify card.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click Add shipping details.
  4. Proceed to confirm page.
  5. On confirm page, click Legal name.
  6. Click Confirm.
  7. Click RHP back button on confirm page.
    → RHP returns to the 4th step which is the phone number step.
  8. Click Next.
  9. On confirm page, click Legal name.
  10. Click Confirm.
  11. Click browser or device back button on confirm page.

Expected Result:

RHP will return to the 4th step which is the phone number step.

Actual Result:

RHP returns to legal name step.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7056793_1769211329495.6.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jan 24, 2026
  2. melvin-bot commented on Jan 24, 2026

    @melvin-bot

    @arosiclair recently merged #78266, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on Jan 24, 2026

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (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.

  4. melvin-bot commented on Jan 24, 2026

    @melvin-bot

    Triggered auto assignment to @MarioExpensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jan 24, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. github-actions commented on Jan 24, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  7. OSBotify commented on Jan 24, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78266 - "Feat: use sub page hook" by @MrMuzyk (High confidence)
    Related Issues: None

    Recommendation: REVERT

    The bug is caused by how the new useSubPage hook handles navigation history in edit mode. When users navigate to a previous step for editing, the hook pushes a new entry to the navigation history stack instead of replacing it. This causes the browser/device back button to navigate to duplicate entries in the history stack rather than the expected previous page.

    Labels: No label changes needed - keeping DeployBlockerCash as this is a Frontend (App) bug

    📋 Detailed Analysis

    Evidence

    • PR Feat: use sub page hook #78266 was merged to main on 2026-01-23 at 15:07:01Z
    • The issue is reproducible on staging (v9.3.8-0) but NOT on production
    • PR Feat: use sub page hook #78266 is listed in the StagingDeployCash checklist for v9.3.8-0
    • The bug specifically affects the "Add shipping details" flow which was refactored in this PR

    Verification

    The bug affects the Missing Personal Details flow at:

    • /home/runner/work/App/App/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx
    • /home/runner/work/App/App/src/hooks/useSubPage/index.tsx

    PR #78266 introduced the new useSubPage hook and refactored the MissingPersonalDetails component to use it. The PR modified these exact files.

    Root Cause

    The issue is in the moveTo function (line 87-94 of src/hooks/useSubPage/index.tsx):

    const moveTo = (step: number, turnOnEditMode?: boolean) => {
        const pageName = pages.at(step)?.pageName;
        if (!pageName) {
            return;
        }
        const shouldEdit = !(turnOnEditMode !== undefined && !turnOnEditMode);
        navigateToPage(pageName, shouldEdit ? 'edit' : undefined);
    };

    The navigateToPage function calls Navigation.navigate() which pushes a new entry to the navigation history stack.

    Navigation flow that causes the bug:

    1. User is on confirm page
    2. User clicks "Legal name" to edit → moveTo(0) pushes missing-personal-details/legal-name/edit to history
    3. User clicks RHP back button → Navigation.goBack() pops to confirm page
    4. User clicks "Legal name" again → moveTo(0) pushes another missing-personal-details/legal-name/edit to history
    5. User clicks browser back button → pops to the duplicate legal-name/edit entry from step 2 (not to confirm page or phone number page)

    Expected behavior: The browser back button should follow the same logic as the RHP back button - return to the confirmation page when in edit mode, or return to the previous step (phone number) when navigating normally.

    Fix approach: The moveTo function should use Navigation.navigate(..., {forceReplace: true}) when entering edit mode to replace the current history entry instead of pushing a new one. Alternatively, implement proper browser back button handling that respects the edit mode state.

  8. 4 remaining items

  9. MrMuzyk commented on Jan 26, 2026

    @MrMuzyk
    Contributor

    On it

  10. MrMuzyk commented on Jan 27, 2026

    @MrMuzyk
    Contributor

    This behaviour is actually intended and Im not sure whether we want to change it.
    Unless user is editing a field from confirmations screen then pressing on `back arrow' from the header should move him back to previous step.

    @arosiclair wdyt?

  11. arosiclair commented on Jan 27, 2026

    @arosiclair
    Contributor

    Yeah I think this behavior is fine for now. Let's close this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions