Skip to content

[Due for payment 2026-05-26] [Due for payment 2026-05-26] Report - Back button return the user to Upgrade page #90852

Closed

Description

@lanitochka17

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.75-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #88374
Email or phone of affected tester (no customers): testpayment935@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11 pro /Chrome
App Component: Chat Report View

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Sign in with a brand-new account that has no workspace.(e.g. use Something else option)
  3. From the FAB and from the Reports/Expenses page, verify the Create report option is visible.
  4. Click Create report.
  5. Tap Upgrade, then Got it, thanks on the confirmation step.
  6. Press back from the report and verify

Expected Result:

User should return to the originating screen, not the upgrade step.

Actual Result:

User return to upgrade step.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7155466_1778881545787.bandicam_2026-05-15_22-04-26-251.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCash
    Daily
    on May 16, 2026
  2. added
    Bug
    on May 16, 2026
  3. melvin-bot commented on May 16, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #88374

  4. melvin-bot commented on May 16, 2026

    @melvin-bot

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

  5. github-actions commented on May 16, 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.
  6. OSBotify commented on May 16, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #88374 - "Reapply: Show Create Report CTA for users without a workspace" by @mukhrr (High confidence)
    Related Issues: #83782, #84139

    Recommendation: REVERT

    PR #88374 introduced a regression in the back navigation for the "Create report" upgrade flow. After tapping "Upgrade" and then "Got it, thanks", the user is returned to the upgrade step instead of the originating screen.

    Assigned: @mukhrr (PR author), @eVoloshchak (approving reviewer), @marcaaron (approving reviewer) from highest-confidence causing PR only
    Labels: DeployBlockerCash kept (frontend App PR caused this). DeployBlocker is not present and should not be added.

    📋 Detailed Analysis

    Evidence

    Verification

    Root Cause

    In the UPGRADE_PATHS.REPORTS case inside afterUpgradeAcknowledged (in IOURequestStepUpgrade.tsx), the new code from PR #88374 is:

    if (action === CONST.IOU.ACTION.CREATE && policyID) {
        // create report and navigate with forceReplace
    } else {
        Navigation.goBack();
        navigateWithMicrotask(ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(...));
    }
    

    The policyID here is read from policyDataRef.current?.policyID, which is the ID of the newly-created workspace. The bug occurs because when the user taps "Got it, thanks" (the confirmation step), policyID may be undefined or not yet populated in policyDataRef.current at the time afterUpgradeAcknowledged runs. This sends the user into the else branch, which calls Navigation.goBack() and then navigates to MONEY_REQUEST_STEP_REPORT — but Navigation.goBack() with no active report takes the user back to the upgrade screen, producing the described regression.

    Before PR #88374, this code path called Navigation.goBack() followed by a navigation to NEW_REPORT_WORKSPACE_SELECTION, which was itself a different flow. The refactor broke the specific "no workspace" case.

  7. MelvinBot commented on May 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    After the upgrade completes and the user presses "Got it, thanks", the afterUpgradeAcknowledged callback creates the report and navigates with Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(newReportID), {forceReplace: true}). The forceReplace option only sets the action type to REPLACE in the central pane navigator — it does not dismiss the RHP modal that contains the upgrade screen. The upgrade screen remains in the navigation stack, so pressing back returns to it.

    What changes do you think we should make in order to solve the problem?

    In IOURequestStepUpgrade.tsx, the CONST.UPGRADE_PATHS.REPORTS case with action === CONST.IOU.ACTION.CREATE should dismiss the RHP before navigating to the report. Replace the Navigation.navigate call with Navigation.dismissModalWithReport({reportID: newReportID}) (or use Navigation.dismissModal with an afterTransition callback that navigates to the report route), following the same pattern used elsewhere in the codebase for navigating to a report from an RHP screen.

    What alternative solutions did you explore?

    Using Navigation.goBack() before navigating would also remove the upgrade screen, but dismissModalWithReport is the established pattern for this exact scenario (navigating to a report from inside an RHP) and handles edge cases around transition timing.

    Investigation details

    Data flow:

    1. User clicks "Create report" → useCreateReport hook detects no valid workspace → pushes MONEY_REQUEST_UPGRADE route into the RHP
    2. User upgrades (creates workspace) → presses "Got it, thanks" → afterUpgradeAcknowledged fires
    3. UPGRADE_PATHS.REPORTS case calls createReportForCurrentUser then Navigation.navigate with forceReplace: true
    4. forceReplace in linkTo only sets action.type = REPLACE on the target navigator action — it does not close the RHP
    5. RHP upgrade screen stays in the stack → back button returns to it

    Correct pattern: Navigation.dismissModalWithReport dismisses the RHP first, then navigates to the report in the central pane.

    Possibly related: Expensify/App#90613 — "Distance upgrade page reappeared" — may share the same root cause (RHP not dismissed after upgrade).


    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.

  8. added
    Reviewing
    on May 18, 2026
  9. 18 remaining items

  10. added
    Daily
    Awaiting Payment
    and removed
    Weekly
    on May 25, 2026
  11. melvin-bot commented on May 25, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. melvin-bot commented on May 26, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  13. mallenexpensify commented on May 27, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif paid $250 via Upwork.

    @aimane-chnaif can you please accept the job below? Please reply here and tag me once you have.
    If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
    https://www.upwork.com/jobs/~022059772196511644756

    ^ Test case created. Thx

  14. added
    Daily
    and removed
    Daily
    on May 27, 2026
  15. aimane-chnaif commented on Jun 2, 2026

    @aimane-chnaif
    Contributor

    @mallenexpensify accepted offer

  16. mallenexpensify commented on Jun 2, 2026

    @mallenexpensify
    Contributor

    @aimane-chnaif paid, summary updated above. Thx.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions