Skip to content

[Due for payment 2026-04-23] Expense - Not here page opens after deleting expenses #87199

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Open the expense report.
  5. Create another expense (or split the expense).
  6. Bulk select both expenses.
  7. Click dropdown button > Delete > Delete.

Expected Result:

Not here page will not open after deleting expenses.

Actual Result:

Not here page opens after deleting expenses.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7123244_1775525232233.5.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  2. melvin-bot commented on Apr 7, 2026

    @melvin-bot

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

  3. melvin-bot commented on Apr 7, 2026

    @melvin-bot

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

  4. github-actions commented on Apr 7, 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.
  5. OSBotify commented on Apr 7, 2026

    @OSBotify
    Contributor

    Investigation Summary: Frontend bug. Causing PR: #86721 (decompose ReportScreen 6d: extract navigate-away handler by @adhorodyski, High confidence). Recommendation: REVERT. PR 86721 is a pure refactor extracting navigate-away logic from ReportScreen into a new ReportNavigateAwayHandler component. The refactor introduced a behavioral regression in the bulk-delete expense scenario. In the new component, report is subscribed directly via useOnyx on the raw collection key, whereas ReportScreen used a memoized lightweight report from reportByIDsSelector with different shape and memoization behavior. This causes isEmpty(report) and isMoneyRequestReport(prevReport) to be truthy simultaneously during bulk delete intermediate states, incorrectly triggering navigation away to the Not here page. Reverting restores the original behavior with no loss of functionality. Labels: DeployBlockerCash kept (frontend App PR). DeployBlocker should be removed (fix is in App, not backend).

  6. removed
    DeployBlockerIndicates it should block deploying the API
    on Apr 7, 2026
  7. MelvinBot commented on Apr 7, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: When all expenses on a report are bulk-deleted, the bulk delete flow never sets deleteTransactionNavigateBackUrl, so the "Not Found" guard is not suppressed — it shows the "Hmm… it's not here" page before navigation away can complete.

    Recommended Fix: The bulk delete path in useDeleteTransactions.ts (or useSelectedTransactionsActions.ts) should set deleteTransactionNavigateBackUrl before performing the deletion, similar to how single-transaction deletion does it. This would suppress both ReportNotFoundGuard and SearchMoneyRequestReportPage's shouldShowAccessErrorPage check.

    Investigation details

    How the bug happens step-by-step

    1. User bulk-selects all expenses on a report and clicks Delete.
    2. handleDeleteTransactionsWithNavigation (useSelectedTransactionsActions.ts) calls Navigation.goBack() first, then waits for TRANSITION_END_SCREEN_WRAPPER before deleting.
    3. deleteTransactions in useDeleteTransactions.ts:181-206 loops through each transaction, calling deleteMoneyRequest and accumulating deletedTransactionIDs.
    4. For the last transaction, prepareToCleanUpMoneyRequest at IOU/index.ts:5415 determines shouldDeleteIOUReport = true because after filtering out pending deletions, only 1 transaction remains.
    5. The optimistic update sets report.reportID = null and pendingFields.preview = DELETE (IOU/index.ts:6045-6054).
    6. Critical gap: Unlike single-transaction deletion, the bulk flow never calls setDeleteTransactionNavigateBackUrl — useDeleteTransactions.ts and useSelectedTransactionsActions.ts have zero references to it.
    7. In SearchMoneyRequestReportPage (line 328), shouldShowAccessErrorPage checks deleteTransactionNavigateBackUrl — if set, it returns false (suppresses NotFound). Since it's never set during bulk delete, the check falls through to line 336 where wereAllTransactionsDeleted = true → shows the "Not here" page.
    8. Similarly, in ReportNotFoundGuard (line 61): shouldShowNotFoundPage = !deleteTransactionNavigateBackUrl && ... !reportExists → shows NotFound because reportID is null and the URL is not set.

    Why single delete works but bulk delete doesn't

    Single-transaction deletion in deleteMoneyRequest returns urlToNavigateBack and the caller sets deleteTransactionNavigateBackUrl in Onyx. Both ReportNotFoundGuard and SearchMoneyRequestReportPage check this key and suppress the NotFound page when it's set. The bulk delete path discards this return value entirely.

    PR #86721 connection

    PR #86721 extracted ReportNavigateAwayHandler from ReportScreen as a pure refactor. The extraction itself is not the root cause — the missing deleteTransactionNavigateBackUrl in bulk delete existed before PR #86721. However, the refactor may have changed the timing of when the navigate-away effect fires relative to the NotFound guard render, making the race condition more visible. Before the extraction, the logic was inline in ReportScreen and may have executed in a different render cycle.

    Possibly related issues


    Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  8. 10 remaining items

  9. melvin-bot commented on Apr 7, 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. roryabraham commented on Apr 7, 2026

    @roryabraham
    Contributor
  11. m-natarajan commented on Apr 7, 2026

    @m-natarajan

    Not reproduce, Chrome / v9.3.53-7

    Screen.Recording.2026-04-07.at.23.55.21.mp4
  12. melvin-bot commented on Apr 7, 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.

  13. melvin-bot commented on Apr 8, 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.

  14. changed the title [-]Expense - Not here page opens after deleting expenses[/-] [+][Due for payment 2026-04-23] Expense - Not here page opens after deleting expenses[/+] on Apr 16, 2026
  15. melvin-bot commented on Apr 16, 2026

    @melvin-bot

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

  16. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-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-04-23. 🎊

  17. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @rlinoz 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]

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions