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
[Due for payment 2026-08-05] Expense - Merged expense opens on Spend after merging expenses on Inbox #97147
Version Number: 9.4.45-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:#96897 Email or phone of affected tester (no customers):sjdoinjsdoiosjdisojdiso1@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:
Go to staging.new.expensify.com
Go to workspace chat.
Create two expenses.
Open the report.
Open any expense.
Click More > Merge.
Complete merging with another expense.
Expected Result:
Merged expense will open on Inbox after merging expenses on Inbox.
Actual Result:
Merged expense opens on Spend after merging expenses on Inbox.
👋 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.
Root Cause: Regression from Expensify/App#96897 ("migrate merge transaction v2"). That PR added a catch‑all redirect '/merge/*': '/search/merge/$1' in OldRoutes.ts. When you start a merge from the Inbox, the merge dynamic-route path collapses to a bare merge/... and this redirect forces it under the Search fullscreen navigator. So at merge time isSearchTopmostFullScreenRoute() returns true, and the post-merge branch in DynamicConfirmationPage.tsx:120-126 navigates to ROUTES.SEARCH_REPORT (the Spend tab) instead of dismissing back to the Inbox report.
Note isOnSearch itself is still correctly false from the Inbox — the bad tab comes entirely from isSearchTopmostFullScreenRoute() flipping to true.
Recommended Fix: As a deploy blocker, the safest resolution is a full revert of #96897. It touches shared navigation infrastructure (ROUTES/SCREENS/config/ModalStackNavigators + new dynamic-route helpers) and the failure mode spans multiple merge entry points that are hard to fully reason about under time pressure. A revert restores the prior standalone RHP merge routes where the modal opened over the true originating navigator.
If a revert is undesirable, the targeted fix is to stop pinning base-less merge URLs to Search: remove/replace the '/merge/*': '/search/merge/$1' redirect and ensure the merge dynamic route is always appended to a fullscreen-qualified base path matching the true origin (getMergeTransactionBasePath() in MergeTransaction.ts:87-94). This is riskier to get right quickly than a straight revert.
Investigation details & evidence chain
Post-merge branch (unchanged by the PR):DynamicConfirmationPage.tsx:120-126 — if ((isOnSearch || isSearchTopmostFullScreenRoute()) && searchReportIDToOpen) { dismissModal(); navigate(ROUTES.SEARCH_REPORT…) }. With isOnSearch === false from Inbox, only isSearchTopmostFullScreenRoute() returning true can trigger the Spend-tab navigation.
isOnSearch is correctly false from Inbox:MoneyRequestHeaderSecondaryActions.tsx:192 computes isReportInSearch = report is a Search screen — false for a workspace-chat expense — and passes it through setupMergeTransactionDataAndNavigate.
The dynamic-route migration mounts the merge steps as a suffix on the current path via createDynamicRoute(DYNAMIC_ROUTES.MERGE_TRANSACTION_*.getRoute(...), getMergeTransactionBasePath()) in MergeTransaction.ts. When the base collapses to a bare merge/..., getStateFromPath applies the OldRoutes redirect first (getMatchingNewRoute.ts), rewriting it to /search/merge/... → Search fullscreen navigator.
The PR's own test documents the intent:getMatchingNewRouteTest.ts:211-215 asserts getMatchingNewRoute('/merge/123') → '/search/merge/123'.
Confidence: Medium-High. The /merge/* → /search/merge/$1 redirect is the only PR-introduced change that flips isSearchTopmostFullScreenRoute() to true while isOnSearch stays false. The one step not verified at runtime is exactly when the Inbox base path collapses to a bare merge/... (vs. /r/:reportID/merge/...); a quick repro logging getTopmostFullScreenRoute()?.name at merge time from the Inbox would fully close the loop.
Alternative explanations considered:isOnSearch being wrongly set (ruled out — it's derived from the origin screen and is false from Inbox); the mergeExpenses logic itself changing (ruled out — that function was not modified by the PR).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/blob/4c66847d8cfcd9f0f9632a7950d3386f51c877e4/src/libs/Navigation/linkingConfig/OldRoutes.ts#L68) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Classification: Frontend bug Causing PR: #96897 - "83847 migrate merge transaction v2" by @huult (High confidence) Related Issues: None
Recommendation: REVERT
The regression is confirmed to originate entirely in this App PR's navigation migration, and it touches shared navigation infrastructure (OldRoutes redirects + new dynamic-route helpers) whose failure mode spans multiple merge entry points — a straight revert is the safest way to unblock the deploy. A targeted fix (below) is viable if a revert is undesirable, but it is riskier to land quickly.
Assigned: @huult (PR author), @suneox and @mjasikowski (approving reviewers) from the causing PR Labels: No changes. DeployBlockerCash is kept (App deploy is correctly blocked by a frontend regression). No DeployBlocker label is present, so nothing to remove.
The PR migrated the merge-transaction routes from standalone RHP modal routes to dynamic-route suffixes, and added the catch-all redirect '/merge/*': '/search/merge/$1' in OldRoutes.ts.
The PR's own test documents the intent: getMatchingNewRouteTest.ts asserts getMatchingNewRoute('/merge/123') → '/search/merge/123'.
isOnSearch is correctly false from Inbox: computed as isReportInSearch at MoneyRequestHeaderSecondaryActions.tsx:192 (route.name === SEARCH_REPORT || SEARCH_MONEY_REQUEST_REPORT) — false for a workspace-chat expense opened from Inbox.
So only isSearchTopmostFullScreenRoute() flipping to true can trigger the Spend-tab navigation — and that flip is caused by the merge RHP being mounted under the Search fullscreen navigator.
The merge steps are navigated as dynamic suffixes via createDynamicRoute(DYNAMIC_ROUTES.MERGE_TRANSACTION_*.getRoute(...), getMergeTransactionBasePath()) in MergeTransaction.ts:114-161. The suffix is a bare merge/:transactionID (ROUTES.ts:1141-1188). When the base path from getMergeTransactionBasePath() (MergeTransaction.ts:87-94) collapses so the resulting path is a bare merge/..., getStateFromPath applies the OldRoutes redirect first, rewriting it to /search/merge/... → Search fullscreen navigator.
Root Cause
The catch-all '/merge/*' → '/search/merge/$1' redirect unconditionally pins any base-less merge URL under the Search fullscreen navigator. Starting a merge from Inbox produces such a base-less merge/... path, so the merge RHP is mounted under Search rather than the true originating (Inbox) navigator. At merge completion, isSearchTopmostFullScreenRoute() returns true (while isOnSearch stays correctly false), so DynamicConfirmationPage takes the search branch and navigates to ROUTES.SEARCH_REPORT — the Spend tab — instead of dismissing back to Inbox.
Targeted fix (if not reverting): stop pinning base-less merge URLs to Search — remove/replace the '/merge/*': '/search/merge/$1' redirect and ensure the merge dynamic route is always appended to a fullscreen-qualified base path matching the true origin via getMergeTransactionBasePath().
Alternatives considered & ruled out:isOnSearch being wrongly set (it is derived from the origin screen and is false from Inbox); a change to the mergeExpenses/mergeTransactionRequest logic (not modified by this PR).
changed the title [-]Expense - Merged expense opens on Spend after merging expenses on Inbox[/-][+][Due for payment 2026-08-05] Expense - Merged expense opens on Spend after merging expenses on Inbox[/+]on Jul 29, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.45-14 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-08-05. 🎊
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]
Activity
applause-bot commentedon Jul 27, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/c0c6b5a8af09a2ac8b4393523d9b4833a3d5de2d78995d9b535394e726468a36
melvin-bot commentedon Jul 27, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #96897
melvin-bot commentedon Jul 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 27, 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:
MelvinBot commentedon Jul 27, 2026
Issue Analysis
Root Cause: Regression from Expensify/App#96897 ("migrate merge transaction v2"). That PR added a catch‑all redirect
'/merge/*': '/search/merge/$1'inOldRoutes.ts. When you start a merge from the Inbox, the merge dynamic-route path collapses to a baremerge/...and this redirect forces it under the Search fullscreen navigator. So at merge timeisSearchTopmostFullScreenRoute()returnstrue, and the post-merge branch inDynamicConfirmationPage.tsx:120-126navigates toROUTES.SEARCH_REPORT(the Spend tab) instead of dismissing back to the Inbox report.Note
isOnSearchitself is still correctlyfalsefrom the Inbox — the bad tab comes entirely fromisSearchTopmostFullScreenRoute()flipping totrue.Recommended Fix: As a deploy blocker, the safest resolution is a full revert of #96897. It touches shared navigation infrastructure (ROUTES/SCREENS/config/ModalStackNavigators + new dynamic-route helpers) and the failure mode spans multiple merge entry points that are hard to fully reason about under time pressure. A revert restores the prior standalone RHP merge routes where the modal opened over the true originating navigator.
If a revert is undesirable, the targeted fix is to stop pinning base-less merge URLs to Search: remove/replace the
'/merge/*': '/search/merge/$1'redirect and ensure the merge dynamic route is always appended to a fullscreen-qualified base path matching the true origin (getMergeTransactionBasePath()inMergeTransaction.ts:87-94). This is riskier to get right quickly than a straight revert.Investigation details & evidence chain
Post-merge branch (unchanged by the PR):
DynamicConfirmationPage.tsx:120-126—if ((isOnSearch || isSearchTopmostFullScreenRoute()) && searchReportIDToOpen) { dismissModal(); navigate(ROUTES.SEARCH_REPORT…) }. WithisOnSearch === falsefrom Inbox, onlyisSearchTopmostFullScreenRoute()returningtruecan trigger the Spend-tab navigation.isOnSearchis correctly false from Inbox:MoneyRequestHeaderSecondaryActions.tsx:192computesisReportInSearch= report is a Search screen — false for a workspace-chat expense — and passes it throughsetupMergeTransactionDataAndNavigate.The dynamic-route migration mounts the merge steps as a suffix on the current path via
createDynamicRoute(DYNAMIC_ROUTES.MERGE_TRANSACTION_*.getRoute(...), getMergeTransactionBasePath())inMergeTransaction.ts. When the base collapses to a baremerge/...,getStateFromPathapplies the OldRoutes redirect first (getMatchingNewRoute.ts), rewriting it to/search/merge/...→ Search fullscreen navigator.The PR's own test documents the intent:
getMatchingNewRouteTest.ts:211-215assertsgetMatchingNewRoute('/merge/123')→'/search/merge/123'.Confidence: Medium-High. The
/merge/*→/search/merge/$1redirect is the only PR-introduced change that flipsisSearchTopmostFullScreenRoute()totruewhileisOnSearchstaysfalse. The one step not verified at runtime is exactly when the Inbox base path collapses to a baremerge/...(vs./r/:reportID/merge/...); a quick repro logginggetTopmostFullScreenRoute()?.nameat merge time from the Inbox would fully close the loop.Alternative explanations considered:
isOnSearchbeing wrongly set (ruled out — it's derived from the origin screen and is false from Inbox); themergeExpenseslogic itself changing (ruled out — that function was not modified by the PR).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/blob/4c66847d8cfcd9f0f9632a7950d3386f51c877e4/src/libs/Navigation/linkingConfig/OldRoutes.ts#L68)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
MelvinBot commentedon Jul 27, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #96897 - "83847 migrate merge transaction v2" by @huult (High confidence)
Related Issues: None
Recommendation: REVERT
The regression is confirmed to originate entirely in this App PR's navigation migration, and it touches shared navigation infrastructure (OldRoutes redirects + new dynamic-route helpers) whose failure mode spans multiple merge entry points — a straight revert is the safest way to unblock the deploy. A targeted fix (below) is viable if a revert is undesirable, but it is riskier to land quickly.
Assigned: @huult (PR author), @suneox and @mjasikowski (approving reviewers) from the causing PR
Labels: No changes.
DeployBlockerCashis kept (App deploy is correctly blocked by a frontend regression). NoDeployBlockerlabel is present, so nothing to remove.📋 Detailed Analysis
Evidence
'/merge/*': '/search/merge/$1'inOldRoutes.ts.getMatchingNewRouteTest.tsassertsgetMatchingNewRoute('/merge/123')→'/search/merge/123'.Verification
DynamicConfirmationPage.tsx:119-126—if ((isOnSearch || isSearchTopmostFullScreenRoute()) && searchReportIDToOpen) { dismissModal(); navigate(ROUTES.SEARCH_REPORT…) }.isOnSearchis correctlyfalsefrom Inbox: computed asisReportInSearchatMoneyRequestHeaderSecondaryActions.tsx:192(route.name === SEARCH_REPORT || SEARCH_MONEY_REQUEST_REPORT) — false for a workspace-chat expense opened from Inbox.isSearchTopmostFullScreenRoute()flipping totruecan trigger the Spend-tab navigation — and that flip is caused by the merge RHP being mounted under the Search fullscreen navigator.createDynamicRoute(DYNAMIC_ROUTES.MERGE_TRANSACTION_*.getRoute(...), getMergeTransactionBasePath())inMergeTransaction.ts:114-161. The suffix is a baremerge/:transactionID(ROUTES.ts:1141-1188). When the base path fromgetMergeTransactionBasePath()(MergeTransaction.ts:87-94) collapses so the resulting path is a baremerge/...,getStateFromPathapplies theOldRoutesredirect first, rewriting it to/search/merge/...→ Search fullscreen navigator.Root Cause
The catch-all
'/merge/*' → '/search/merge/$1'redirect unconditionally pins any base-less merge URL under the Search fullscreen navigator. Starting a merge from Inbox produces such a base-lessmerge/...path, so the merge RHP is mounted under Search rather than the true originating (Inbox) navigator. At merge completion,isSearchTopmostFullScreenRoute()returnstrue(whileisOnSearchstays correctlyfalse), soDynamicConfirmationPagetakes the search branch and navigates toROUTES.SEARCH_REPORT— the Spend tab — instead of dismissing back to Inbox.Targeted fix (if not reverting): stop pinning base-less merge URLs to Search — remove/replace the
'/merge/*': '/search/merge/$1'redirect and ensure the merge dynamic route is always appended to a fullscreen-qualified base path matching the true origin viagetMergeTransactionBasePath().Alternatives considered & ruled out:
isOnSearchbeing wrongly set (it is derived from the origin screen and isfalsefrom Inbox); a change to themergeExpenses/mergeTransactionRequestlogic (not modified by this PR).huult commentedon Jul 28, 2026
Checking
huult commentedon Jul 28, 2026
https://github.com/huult/App/tree/main/src/components/MoneyRequestHeaderSecondaryActions.tsx#L381-L386
It's the same issue caused by isOnSearch being set incorrectly. We just need to update the parameter so it's set correctly. I'll open a PR to fix it.
huult commentedon Jul 28, 2026
App/src/pages/TransactionMerge/MergeTransactionsListContent.tsx
Line 167 in 7392971
This issue was introduced when we added
isOnSearchhere. It should beundefined, just like it was in the previous PR: https://github.com/Expensify/App/pull/96897/changes#diff-ba1b9f7890cc906ffeb81402632b5ba4f91fa49ed0b648dcb41f241bd7365ef7R167mjasikowski commentedon Jul 28, 2026
Fix merged, CP requested
mjasikowski commentedon Jul 29, 2026
Not reproducible after CP
[-]Expense - Merged expense opens on Spend after merging expenses on Inbox[/-][+][Due for payment 2026-08-05] Expense - Merged expense opens on Spend after merging expenses on Inbox[/+]melvin-bot commentedon Jul 29, 2026
@suneox / @huult
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.45-14 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-08-05. 🎊
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]