Skip to content

Spend - Wrong expense opens after returning from expense report #103221

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.3-2
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: https://github.com/Expensify/App/pull/
Email or phone of affected tester (no customers): jsoidjndoiniodnsjojd@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Open 1:1 DM with other user.
  3. Click + > Pay.
  4. Enter amount > Next > Mark as paid.
  5. Go to workspace chat.
  6. Create expense A and click Submit.
  7. Create expense B.
  8. Open expense B > click Report field > select the report that contains Expense A.
  9. Go to Spend > Expenses.
  10. Open the first expense.
  11. Navigate through all three expenses via navigation arrow.
  12. Navigate back to the first expense via arrow.
  13. Click on the report link in "moved to expense from.." system message.
  14. Click RHP back button.

Expected Result:

The first expense (1 of 3) will open.

Actual Result:

The second expense (2of 3) opens.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7279054_1791305285862.22.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7279054

Activity

  1. added
    DeployBlockerCash
    Bug
    on Oct 6, 2026
  2. applause-bot commented on Oct 6, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/90aa92202e15d6aa35c21b1d8bd519c86e0b49149aa8640c19aaf8bc6c347c00

  3. melvin-bot commented on Oct 6, 2026

    @melvin-bot

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

  4. melvin-bot commented on Oct 6, 2026

    @melvin-bot

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

  5. github-actions commented on Oct 6, 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. MelvinBot commented on Oct 6, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Investigation

    Causing PR: Standardize Expense Report and Expense header with predictable button placement and carousel counter by thelullabyy. Approved by ShridharGoel and JS00001. Merged 2026-10-05 and included in Deploy Checklist: New Expensify 2026-10-05.

    Confidence: Medium. I traced this through the code. I did not reproduce it.

    Recommendation: Revert #100331. It has now caused two blockers in this same flow. If you revert it, revert [cp staging] Spend - App crashes after returning to expense RHP from expense report with it.

    Related: This flow is the same as Spend - App crashes after returning to expense RHP from expense report, which is still open. The cherry-picked fix (#103202) stopped the crash. It did not change where RHP back goes, so the same steps now open expense 2 instead of crashing.

    How it happens

    Links use App commit e57c3463d0e9be27ca7898b9444df3b83e876566, which includes #103202.

    1. Each arrow press saves the expense you just left as backTo (MoneyRequestReportTransactionsNavigation.tsx:231-239, :384). After 1→2→3→2→1, the expense 1 screen has backTo set to the expense 2 route.
    2. The "moved expense from…" report link reuses that backTo because it starts with search (getReportURLForCurrentContext.ts:42-49, :59-64).
    3. The report's RHP back button calls Navigation.goBack(backToRoute) (MoneyRequestReportView.tsx:169-186).
    4. The expense 2 route does not match the expense 1 screen in the stack. goUp compares params (Navigation.ts:353) and replaces the screen with expense 2 (Navigation.ts:603-610). That is the "2 of 3" in the video.

    The new unit test from #103202 in tests/unit/ReportUtilsTest.ts expects the link's backTo to be the second expense route. So the crash fix locks in the wrong target.

    #100331 changed this flow in three ways:

    • It adds ?anchorTransactionID= before backTo on SEARCH_REPORT (ROUTES.ts:2121-2134). This caused the earlier crash.
    • It sends both arrows through one navigateToSibling helper, which also sets anchorTransactionID.
    • It adds the "1 of 3" counter, which makes the wrong landing visible.
    Why medium confidence
    If you fix forward instead
    1. In getReportURLForCurrentContext, ignore a backTo that points to another expense RHP (search/view/...). Use the current expense route or the original search route instead.
    2. Update the [cp staging] Spend - App crashes after returning to expense RHP from expense report #103202 test to expect that route.
    3. Check production for the same arrow-then-back behavior before deciding whether it blocks the deploy.

    Labels: Keep DeployBlockerCash. This is a frontend bug.


    Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.


    view run

  7. JS00001 commented on Oct 6, 2026

    @JS00001
    Contributor

    Discussed this with jason, we will fix this in a follow up, but we shouldnt block the feature on this. Demoting & added to the follow up issue: #103200

  8. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Oct 6, 2026
  9. melvin-bot commented on Oct 6, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    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.

  10. added
    Reviewing
    Weekly
    Daily
    and removed
    Daily
    Reviewing
    Weekly
    on Oct 13, 2026
  11. melvin-bot commented on Oct 20, 2026

    @melvin-bot

    @mjasikowski

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.14-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Assignees

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions