Skip to content

[Due for payment 2026-06-22] [Due for payment 2026-06-19] Expense - Not here page opens after resolving duplicates and clicking browser back button #93363

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. Open one of the expenses from Step 3.
  5. Click Review duplicates.
  6. Select the second expense.
  7. Click Keep selected > Confirm.
  8. Click browser back button.

Expected Result:

Not here page will not open (similar production).

Actual Result:

Not here page opens after resolving duplicates and clicking browser back button.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7178415_1781224106634.5.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7178415

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/5b73a2e2c95c2ec86f2b35c1d89b65a02bff009a045bc50f40f3f707531555c8

  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

    Please re-state the problem that we are trying to solve in this issue.

    After merging two duplicate expenses that live in different reports (Review Duplicates → keep the second one → Confirm), pressing the browser back button lands on the "Hmm... it's not here" NotFoundPage. This is a regression from #92838 (which fixed #92302) and is the reason this is a deploy blocker.

    What is the root cause of that problem?

    The new merge flow navigates forward with Navigation.goBack(keptReportRoute) instead of dismissModal(). Because the kept transaction's expense report was never on the navigation stack, goBack resolves to a REPLACE, not a pop — so on web it calls history.replace. The browser history entries for the discarded transaction thread (/r/<discardedThread> and .../duplicates/review) are left intact, now pointing at data the merge soft-deleted/tore down.

    The PR's safety net, setDeleteTransactionNavigateBackUrl(keptReportRoute), is supposed to suppress the NotFoundPage — but it stores /r/<keptReportID>, which does not contain /duplicates/review. So the instant the user presses back and the kept report unfocuses, DeleteTransactionNavigateBackHandler clears the suppressor NVP (its /duplicates/review guard doesn't match). With the suppressor gone and the discarded thread torn down, Review.tsx / ReportNotFoundGuard compute shouldShowNotFound = true and render the "Not here" page.

    The sibling resolveDuplicates flow is unaffected because it never soft-deletes IOU actions or tears down threads, so its back-target stays a live report.

    Evidence & data flow (high confidence)

    Navigation rewrite — Confirmation.tsx:104-123. mergeParams.reportID is the kept transaction's expense report (from buildMergeDuplicatesParams), which is not the topmost report (the discarded transaction thread), so the else → goBack(keptReportRoute) branch runs.

    goBack → REPLACE — Navigation.ts:511-545 defers to goUp; in goUp:425-502 indexOfBackToRoute === -1 ⇒ dispatches REPLACE. On web, useLinking maps historyDelta == 0 to history.replace, leaving the discarded thread entries in browser history. By contrast dismissModal dispatches a POP (history.go(-1)), which actually consumes a browser entry.

    Suppressor cleared on back — the stored URL /r/<keptReportID> fails the /duplicates/review check in TransactionNavigationUtils.ts:36-49, so DeleteTransactionNavigateBackHandler clears the NVP when the kept report unfocuses → guards render NotFoundPage.

    Soft-delete/teardown that makes the thread "not found" — Duplicate.ts:255-288.

    Flow: open discarded thread → push review → push confirm → confirm sets suppressor /r/<keptReportID> + soft-deletes/teardowns discarded thread → goBack(keptReportRoute) REPLACEs top (discarded entries remain) → kept report focused, suppressor kept → browser back → kept report unfocuses → handler clears suppressor → discarded thread torn down + no suppressor ⇒ NotFoundPage.

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

    The back-target should never be a torn-down thread. Two viable directions:

    1. Don't leave the dead entries in history. After a cross-report merge, navigate so the discarded thread's history entries are removed rather than replaced-over — e.g. dismiss the modal (which pops the browser entry) and then route to the kept report, instead of a fallback goBack(keptReportRoute) that resolves to REPLACE. This restores the pre-PR back-button behavior while keeping the forward redirect to the kept report.

    2. Make the suppressor cover the back navigation. Store a deleteTransactionNavigateBackUrl that points at the discarded thread's /duplicates/review route (so doesDeleteNavigateBackUrlIncludeSpecificDuplicatesReview matches and the guard suppresses NotFoundPage on back), mirroring how the single-report delete-transaction flow already keeps its suppressor alive.

    Option 1 is the cleaner fix since it removes the orphaned history entry entirely rather than papering over it.

    Given this is a time-sensitive deploy blocker, reverting #92838 is also a valid stop-gap — but note that reintroduces the original #92302 (NotFound immediately on Confirm), so a targeted fix is preferable if there's time.

    What alternative solutions did you explore? (Optional)

    N/A


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93363) 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. After a cross-report merge, handleMergeDuplicates navigates with Navigation.goBack(keptReportRoute), where keptReportRoute is the kept transaction's expense report. That report was never on the navigation stack, so goBack resolves to a REPLACE rather than a pop (in goUp, when the target route isn't found in the state, it dispatches a REPLACE). On web a REPLACE overwrites only the current history entry, so the discarded transaction thread's entries (/r/<thread> and …/duplicates/review) are left intact in the browser history.

    At the same time, the suppressor the PR sets (setDeleteTransactionNavigateBackUrl('/r/<keptReportID>')) does not contain /duplicates/review, so DeleteTransactionNavigateBackHandler clears it as soon as the kept report loses focus. When the user then presses the browser Back button they land back on the now torn-down thread/review entry with the suppressor already gone, and the not-found guard renders the "Hmm… it's not here" page.

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

    Don't leave the dead history entries behind. After a cross-report merge opened from a report thread:

    • Dismiss the duplicates modal first — this pops the modal's browser-history entries (…/duplicates/review, …/duplicates/confirm) instead of replacing over them.
    • Then route to the kept report by replacing the now-dead discarded-thread entry, rather than relying on a goBack that resolves to a REPLACE and leaves the dead entry one step back.

    With the dead thread entry removed, the browser Back button lands on a live screen and the not-found page no longer appears. (For the Search entry point the modal should instead be dismissed back to the search results — see #93362.)

    What alternative solutions did you explore? (Optional)

    Keep the suppressor alive across the back navigation by pointing deleteTransactionNavigateBackUrl at a /duplicates/review route so the not-found guard stays suppressed. This papers over the orphaned history entry instead of removing it, so removing the entry is cleaner. Reverting #92838 is a valid stop-gap but reintroduces #92302.

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

    @m-natarajan

    Chrome / v9.4.6-1
    Not reproduce

    REC-20260612205209.mp4
  10. removed
    DeployBlockerCash
    on Jun 12, 2026
  11. added
    Daily
    and removed
    Reviewing
    Hourly
    on Jun 12, 2026
  12. changed the title [-]Expense - Not here page opens after resolving duplicates and clicking browser back button[/-] [+][Due for payment 2026-06-19] Expense - Not here page opens after resolving duplicates and clicking browser back button[/+] on Jun 12, 2026
  13. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  14. 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. 🎊

  15. 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]

  16. changed the title [-][Due for payment 2026-06-19] Expense - Not here page opens after resolving duplicates and clicking browser back button[/-] [+][Due for payment 2026-06-22] [Due for payment 2026-06-19] Expense - Not here page opens after resolving duplicates and clicking browser back button[/+] on Jun 15, 2026
  17. 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. 🎊

  18. 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