Skip to content

[Due for payment 2026-06-22] [Due for payment 2026-06-19] Expense - After resolving duplicate expenses on Spend, app opens report on Inbox #93362

Closed

Description

@applause-bot

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.4.6-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: #92838
Email or phone of affected tester (no customers): jsodinjosdjsoinjsiojs@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create two same expenses on different report.
  4. Go to Spend > Expenses.
  5. Open one of the expenses from Step 3.
  6. Click Review duplicates.
  7. Select the second expense.
  8. Click Keep selected > Confirm.

Expected Result:

App will stay on Spend > Expenses after resolving duplicates.

Actual Result:

App opens report on Inbox after resolving duplicates.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7178413_1781224045842.3.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Vincenzo Godoy
Bug ID: 7178413

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jun 12, 2026
  2. applause-bot commented on Jun 12, 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/5d1b1ec24347048211d1d3c369b9726c5ef4d3678fdcb5873b143a31df9d4bd1

  3. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 12, 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 Jun 12, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a regression from #92838 (deployed in the build this deploy blocker is attached to), which changed the post-merge navigation in handleMergeDuplicates.

    Before that PR, resolving duplicates always called Navigation.dismissModal(), which returns the user to wherever they opened the Review Duplicates flow from (including Spend > Expenses). The PR replaced that unconditional dismiss with a branch:

    The offending branch — Confirmation.tsx:117-122
    const topmostReportID = Navigation.getTopmostReportId?.();
    if (topmostReportID === mergeParams.reportID) {
        Navigation.dismissModal();
    } else {
        Navigation.goBack(keptReportRoute);
    }

    The intent (fixing #92302) was: when the user is sitting on the discarded transaction's thread, route them to the kept report so they don't land on the now-dead thread. But the else branch fires for any case where the report underneath the modal isn't the kept report — and that includes opening Review Duplicates from Search (Spend > Expenses).

    When opened from Search, the expense opens in an RHP over the Search page (MoneyRequestHeaderPrimaryAction.tsx:120), so Navigation.getTopmostReportId() is not the kept report's ID. The condition takes the else branch and runs Navigation.goBack(keptReportRoute), navigating the user into the kept report in the Inbox instead of returning them to Spend > Expenses.

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

    Distinguish "came from the discarded transaction thread" (→ go to kept report) from "came from Search/elsewhere" (→ just dismiss back to origin).

    The Confirmation page already has route.params.backTo, which is populated with the Search route when the flow is opened from Spend > Expenses (see Confirmation.tsx:66). When backTo is set, navigate back to it (or call dismissModal()), so the user returns to where they actually came from. Only fall back to Navigation.goBack(keptReportRoute) when there is no backTo and the user was on the discarded transaction's thread — the original #92302 scenario.

    The setDeleteTransactionNavigateBackUrl(keptReportRoute) hint should likewise only target the kept report when the user is being routed there; from Search it should point back to the Search route so the not-found guard doesn't redirect into the report.

    What alternative solutions did you explore? (Optional)

    Reverting #92838 clears this regression but reintroduces the original "Hmm... it's not here" bug (#92302) for the discarded-thread flow. A targeted fix to the navigation branch is preferable to a revert.

    Confidence & scope

    High confidence on the root cause (the else branch and the Search entry point are both in App code and directly explain the symptom). The fix is entirely within src/pages/TransactionDuplicate/Confirmation.tsx — no backend/other-repo changes required.

    Note the in-code comment at Confirmation.tsx:107-109 assumes the user always wants to end up on the kept report, which is the incorrect assumption behind this regression.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement this to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. MobileMage commented on Jun 12, 2026

    @MobileMage
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a regression from #92838. That PR replaced the unconditional Navigation.dismissModal() at the end of the Review Duplicates merge flow (handleMergeDuplicates in Confirmation.tsx) with a branch keyed on Navigation.getTopmostReportId():

    • if the topmost report equals the kept transaction's expense report → dismissModal()
    • otherwise → Navigation.goBack(keptReportRoute)

    getTopmostReportId() only inspects the Inbox (the Reports split navigator). When the flow is opened from Search (Spend > Expenses) — a separate navigator — it never matches the kept transaction's expense report, so the condition always falls to the else branch and runs goBack(keptReportRoute). That opens the kept report in the Inbox instead of returning the user to the search results. Before #92838 the unconditional dismissModal() returned the user to wherever they opened the flow from, which is why this is not reproducible in production.

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

    Distinguish "opened from Search" from "opened from a report thread" using the backTo param that the confirmation route already carries. When the flow is opened from Search, the Review Duplicates entry point passes the active search route as backTo, and the existing back button (useReviewDuplicatesNavigation) already returns to it. The merge confirm should do the same:

    This keeps the #92302 cross-report fix intact while restoring the pre-regression destination for the Search flow.

    What alternative solutions did you explore? (Optional)

    Reverting #92838 removes this regression but reintroduces the original "Hmm… it's not here" bug (#92302) for cross-report merges, so a targeted navigation fix is preferable.

  8. melvin-bot commented on Jun 12, 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.

  9. added
    Reviewing
    on Jun 12, 2026
  10. m-natarajan commented on Jun 12, 2026

    @m-natarajan

    Chrome / v9.4.6-1
    Passed

    REC-20260612204756.mp4
  11. removed
    DeployBlockerCash
    on Jun 12, 2026
  12. added
    Daily
    and removed
    Reviewing
    Hourly
    on Jun 12, 2026
  13. changed the title [-]Expense - After resolving duplicate expenses on Spend, app opens report on Inbox[/-] [+][Due for payment 2026-06-19] Expense - After resolving duplicate expenses on Spend, app opens report on Inbox[/+] on Jun 12, 2026
  14. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2026-06-19. 🎊

  16. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @Valforte The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

  17. changed the title [-][Due for payment 2026-06-19] Expense - After resolving duplicate expenses on Spend, app opens report on Inbox[/-] [+][Due for payment 2026-06-22] [Due for payment 2026-06-19] Expense - After resolving duplicate expenses on Spend, app opens report on Inbox[/+] on Jun 15, 2026
  18. melvin-bot commented on Jun 15, 2026

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2026-06-22. 🎊

  19. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    @Valforte The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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