You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mWeb - Create Expense - “Hmm It's Not Here” page appears after deleting an expense. #85961
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #79530 - "show not found page for deleted duplicate expense." by @marufsharifi (High confidence) Related Issues: None
Recommendation: REVERT
PR #79530 introduced a regression in the delete expense flow. When deleting an expense from the transaction details view, the code now sets the "navigate back" URL to the current route (the expense being deleted) instead of the parent report. This causes the "Hmm, it's not here" page to appear after deletion because the app tries to navigate to a URL that no longer exists.
Labels: No label changes needed - this is a frontend bug and DeployBlockerCash should remain.
📋 Detailed Analysis
Evidence
PR #79530 was merged on 2026-02-25 and added logic to handle navigation after deleting expenses, primarily focused on duplicate expense scenarios. However, it also modified the regular delete flow in MoneyRequestHeader.tsx.
The bug is reproducible:
On staging (9.3.41-3): Yes ✅
On production (9.3.40-11): No ❌
This confirms the causing PR is in staging but not yet in production.
Verification
The affected code is in /home/runner/_work/App/App/src/components/MoneyRequestHeader.tsx at lines 608-609:
When a user is viewing an expense (e.g., route /r/123456/transaction/789), deleting it sets backToRoute to that same expense route. After deletion completes, the navigation logic tries to navigate to this now-deleted expense, triggering the "Not Found" page.
Root Cause
The issue is in the fallback logic: Navigation.getActiveRoute() returns the current route, which is the expense being deleted. The code should instead navigate to:
The parent report (if there are multiple expenses)
Another expense in the same report
The chat that contains the report
PR #79530's changes were primarily intended for duplicate expense review flows but inadvertently affected the standard expense deletion flow, causing this regression.
Please re-state the problem that we are trying to solve in this issue.
On mWeb, when a user deletes one expense from a report that contains multiple expenses (in a 1:1 DM), a "Hmm, it's not here" not-found page appears instead of navigating back to the remaining expense(s). This is reproducible on staging but not production.
What is the root cause of that problem?
The deletion flow in MoneyRequestHeader.tsx performs two separate Onyx operations sequentially:
setDeleteTransactionNavigateBackUrl(backToRoute) at line 609 — calls Onyx.set(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL, url) (src/libs/actions/Report/index.ts:5589-5591)
deleteTransactions([...]) at line 627 — internally calls deleteMoneyRequest → API.write(WRITE_COMMANDS.DELETE_MONEY_REQUEST, params, {optimisticData}) which applies optimistic Onyx updates marking the parent report action with pendingAction: DELETE
The shouldShowNotFoundPage logic in ReportScreen.tsx (line 488-531) relies on the deleteTransactionNavigateBackUrl being set (line 497-499) to suppress the not-found check when isDeletedTransactionThread becomes true (line 501-503). These two values come from separate Onyx keys subscribed via separate useOnyx hooks.
The race condition is: Onyx.set (for the URL) and API.write → Onyx.update (for the optimistic deletion data) go through different internal Onyx code paths. If the deletion's optimistic updates propagate to the useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS) subscriber (making isDeletedTransactionThread = true) before the URL propagates to useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL), there is a render window where:
isDeletedTransactionThread = true (parent action marked as DELETE)
shouldShowNotFoundPage returns true → "Hmm, it's not here" appears
This explains why it's mWeb-specific and staging-only — it's a timing-sensitive race that depends on Onyx's internal batching behavior and React's render scheduling, which can vary between builds and platforms.
What changes do you think we should make in order to solve the problem?
Include the NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL update as part of the deleteMoneyRequest optimistic data in src/libs/actions/IOU/index.ts, so it's applied atomically in the same Onyx.update() call as the deletion's optimistic updates. This eliminates the race condition by ensuring both changes are delivered to React in the same render cycle.
Specifically, in deleteMoneyRequest (around line 8573 in src/libs/actions/IOU/index.ts), add an optimistic data entry for NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL and accept it as a parameter. Then update MoneyRequestHeader.tsx and MoneyReportHeader.tsx to pass the navigate-back URL through to deleteTransactions/deleteMoneyRequest instead of setting it separately via setDeleteTransactionNavigateBackUrl.
Alternatively, a simpler fix: in shouldShowNotFoundPage (ReportScreen.tsx:488), add a check that also suppresses the not-found page when the parent report action has pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE — this would be a secondary safety net that doesn't rely on the deleteTransactionNavigateBackUrl timing at all.
What alternative solutions did you explore? (Optional)
Awaiting the Onyx.set promise before calling deleteTransactions — this would guarantee order but introduces an unnecessary async gap and could cause other timing issues.
Moving the navigation before the deletion — not viable because the user needs to see the confirm modal result first.
Using Onyx.multiSet to batch both the URL and deletion in one call — this would work but requires restructuring the API call pattern.
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.
Activity
melvin-bot commentedon Mar 20, 2026
Triggered auto assignment to @marcochavezf (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Mar 20, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 20, 2026
👋 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:
OSBotify commentedon Mar 20, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #79530 - "show not found page for deleted duplicate expense." by @marufsharifi (High confidence)
Related Issues: None
Recommendation: REVERT
PR #79530 introduced a regression in the delete expense flow. When deleting an expense from the transaction details view, the code now sets the "navigate back" URL to the current route (the expense being deleted) instead of the parent report. This causes the "Hmm, it's not here" page to appear after deletion because the app tries to navigate to a URL that no longer exists.
Labels: No label changes needed - this is a frontend bug and DeployBlockerCash should remain.
📋 Detailed Analysis
Evidence
PR #79530 was merged on 2026-02-25 and added logic to handle navigation after deleting expenses, primarily focused on duplicate expense scenarios. However, it also modified the regular delete flow in
MoneyRequestHeader.tsx.The bug is reproducible:
This confirms the causing PR is in staging but not yet in production.
Verification
The affected code is in
/home/runner/_work/App/App/src/components/MoneyRequestHeader.tsxat lines 608-609:When a user is viewing an expense (e.g., route
/r/123456/transaction/789), deleting it setsbackToRouteto that same expense route. After deletion completes, the navigation logic tries to navigate to this now-deleted expense, triggering the "Not Found" page.Root Cause
The issue is in the fallback logic:
Navigation.getActiveRoute()returns the current route, which is the expense being deleted. The code should instead navigate to:PR #79530's changes were primarily intended for duplicate expense review flows but inadvertently affected the standard expense deletion flow, causing this regression.
MelvinBot commentedon Mar 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On mWeb, when a user deletes one expense from a report that contains multiple expenses (in a 1:1 DM), a "Hmm, it's not here" not-found page appears instead of navigating back to the remaining expense(s). This is reproducible on staging but not production.
What is the root cause of that problem?
The deletion flow in
MoneyRequestHeader.tsxperforms two separate Onyx operations sequentially:setDeleteTransactionNavigateBackUrl(backToRoute)at line 609 — callsOnyx.set(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL, url)(src/libs/actions/Report/index.ts:5589-5591)deleteTransactions([...])at line 627 — internally callsdeleteMoneyRequest→API.write(WRITE_COMMANDS.DELETE_MONEY_REQUEST, params, {optimisticData})which applies optimistic Onyx updates marking the parent report action withpendingAction: DELETEThe
shouldShowNotFoundPagelogic inReportScreen.tsx(line 488-531) relies on thedeleteTransactionNavigateBackUrlbeing set (line 497-499) to suppress the not-found check whenisDeletedTransactionThreadbecomes true (line 501-503). These two values come from separate Onyx keys subscribed via separateuseOnyxhooks.The race condition is:
Onyx.set(for the URL) andAPI.write→Onyx.update(for the optimistic deletion data) go through different internal Onyx code paths. If the deletion's optimistic updates propagate to theuseOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS)subscriber (makingisDeletedTransactionThread = true) before the URL propagates touseOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL), there is a render window where:isDeletedTransactionThread=true(parent action marked as DELETE)deleteTransactionNavigateBackUrl=undefined(not yet delivered)shouldShowNotFoundPagereturnstrue→ "Hmm, it's not here" appearsThis explains why it's mWeb-specific and staging-only — it's a timing-sensitive race that depends on Onyx's internal batching behavior and React's render scheduling, which can vary between builds and platforms.
What changes do you think we should make in order to solve the problem?
Include the
NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URLupdate as part of thedeleteMoneyRequestoptimistic data insrc/libs/actions/IOU/index.ts, so it's applied atomically in the sameOnyx.update()call as the deletion's optimistic updates. This eliminates the race condition by ensuring both changes are delivered to React in the same render cycle.Specifically, in
deleteMoneyRequest(around line 8573 insrc/libs/actions/IOU/index.ts), add an optimistic data entry forNVP_DELETE_TRANSACTION_NAVIGATE_BACK_URLand accept it as a parameter. Then updateMoneyRequestHeader.tsxandMoneyReportHeader.tsxto pass the navigate-back URL through todeleteTransactions/deleteMoneyRequestinstead of setting it separately viasetDeleteTransactionNavigateBackUrl.Alternatively, a simpler fix: in
shouldShowNotFoundPage(ReportScreen.tsx:488), add a check that also suppresses the not-found page when the parent report action haspendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE— this would be a secondary safety net that doesn't rely on thedeleteTransactionNavigateBackUrltiming at all.What alternative solutions did you explore? (Optional)
Onyx.setpromise before callingdeleteTransactions— this would guarantee order but introduces an unnecessary async gap and could cause other timing issues.Onyx.multiSetto batch both the URL and deletion in one call — this would work but requires restructuring the API call pattern.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.cristipaval commentedon Mar 20, 2026
DUpe of #85954