Skip to content

Expensify Card - Add shipping details RHP appears twice after refreshing page and opening it #80403

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. Close the confirm page.
  6. Refresh the page.
  7. Click Add shipping details.

Expected Result:

Confirm page RHP will not appear twice.

Actual Result:

Confirm page RHP appears twice.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Image
Bug7056790_1769210969425.5.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    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 @lydiabarclay (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 @Beamanator (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 issue is caused by a race condition in the new useSubPage hook where two navigation actions occur when opening the Missing Personal Details flow without a subPage parameter. This causes the RHP to be pushed onto the stack twice.

    Labels: Removing DeployBlocker label (keeping DeployBlockerCash as this is a frontend bug requiring an App PR fix)

    📋 Detailed Analysis

    Evidence

    PR #78266 introduced a new useSubPage hook to replace the previous useSubStep approach. The key change is that navigation is now URL-based, with each sub-page having its own route parameter.

    The bug occurs due to the interaction between:

    1. IssueCardMessage.tsx line 48: Calls Navigation.navigate(ROUTES.MISSING_PERSONAL_DETAILS.getRoute()) with NO arguments
    2. useSubPage/index.tsx lines 25-34: Contains a useEffect that runs once on mount and navigates to startPageName when no urlPageName exists

    Verification

    Files affected by the bug:

    • /home/runner/work/App/App/src/components/ReportActionItem/IssueCardMessage.tsx - Triggers the navigation
    • /home/runner/work/App/App/src/hooks/useSubPage/index.tsx - Contains the problematic useEffect
    • /home/runner/work/App/App/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx - Uses the hook

    Confirmed PR #78266 modifies these files:

    • Created src/hooks/useSubPage/index.tsx (new file)
    • Modified src/components/ReportActionItem/IssueCardMessage.tsx (changed navigation call)
    • Modified src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx (refactored to use new hook)

    Root Cause

    The bug is a double navigation issue:

    1. When "Add shipping details" button is clicked, it calls:

      Navigation.navigate(ROUTES.MISSING_PERSONAL_DETAILS.getRoute())
    2. With no arguments, getRoute() returns "missing-personal-details" (no subPage param)

    3. The MissingPersonalDetailsContent component mounts and useSubPage hook initializes

    4. The hook's useEffect (lines 25-34) detects no urlPageName and executes:

      Navigation.navigate(buildRoute(startPageName), {forceReplace: true});
    5. This creates a second navigation action that pushes another RHP onto the stack

    6. After refresh, when the user reopens the flow, both navigation actions execute, resulting in the RHP appearing twice

    Why it reproduces after refresh specifically:

    • The useEffect uses a hasInitialized ref to run only once per component lifecycle
    • After refresh, the component unmounts/remounts, resetting the ref
    • The double navigation happens again on the fresh mount

    Technical Details

    The problematic code in useSubPage/index.tsx:

    const hasInitialized = useRef(false);
    
    useEffect(() => {
        if (hasInitialized.current) {
            return;
        }
        hasInitialized.current = true;
    
        if (!urlPageName && startPageName) {
            Navigation.navigate(buildRoute(startPageName), {forceReplace: true});
        }
    }, [urlPageName, startPageName, buildRoute]);

    The issue is that forceReplace: true doesn't prevent the double navigation when the initial navigation hasn't completed yet.

  8. 5 remaining items

  9. MrMuzyk commented on Jan 26, 2026

    @MrMuzyk
    Contributor

    On it

  10. added
    Reviewing
    Weekly
    and removed
    Daily
    on Jan 26, 2026
  11. arosiclair commented on Feb 9, 2026

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

Metadata

Metadata

Labels

BugReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions