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
[$250] Expense - Self DM opens instead of transaction thread after merging with unreported expenses #83258
Version Number: 9.3.25-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:#79766 Email or phone of affected tester (no customers):jsodjsodnjoisjdosij@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:
Go to staging.new.expensify.com
Go to self DM.
Create two expenses.
Open any expense.
Click More > Merge.
Select expense from Step 3 > Continue.
Select all the details from the selected expense in Step 6 (all the second options) > Next.
Click Merge expenses.
Expected Result:
Transaction thread will open (similar to production).
👋 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: #79766 - "Fix incorrect chat opening after merging expense with self DM" by @marufsharifi (High confidence) Related Issues: #78842 (original issue that #79766 was fixing), #79275 (first attempt), #79505 (revert of #79275)
Recommendation: ROLL FORWARD
PR #79766 fixed one navigation issue but introduced a regression in a different scenario. The fix is straightforward and localized to the navigation logic. A revert would reintroduce the original bug (#78842), which affects a broader use case.
Labels: Both DeployBlockerCash and DeployBlocker labels should remain. This is a frontend bug that blocks the App deploy.
📋 Detailed Analysis
Evidence
PR #79766 was merged on 2026-02-23 at 09:03:08Z and is included in staging deployment 9.3.25-0. The issue is reproducible on staging but NOT on production, which confirms the timing.
The PR modified src/pages/TransactionMerge/ConfirmationPage.tsx to fix a navigation issue where merging a workspace expense with a self DM expense would incorrectly open the workspace chat instead of the self DM.
However, the fix introduced a regression in a different scenario: when merging two unreported expenses (both in self DM), the navigation now opens the self DM instead of the transaction thread.
Verification
The bug is in the navigation logic in src/pages/TransactionMerge/ConfirmationPage.tsx, specifically lines 108-111:
Both transactions have reportID = CONST.REPORT.UNREPORTED_REPORT_ID
Line 74 converts mergeTransaction.reportID to the actual self DM report ID
reportIDToDismiss becomes the self DM report ID (line 95)
The condition reportID !== targetTransaction.reportID evaluates to selfDMReportID !== UNREPORTED_REPORT_ID, which is true
The code dismisses to the self DM instead of checking if it should open the transaction thread
Root Cause
The navigation logic prioritizes dismissing to the merge destination report (self DM) without checking if there is a transaction thread that should be opened instead. The variable targetTransactionThreadReportID is calculated on line 60 but is not used in the non-search navigation path (lines 108-111).
The fix should check if targetTransactionThreadReportID exists and navigate to it when both transactions are unreported expenses.
Why Roll Forward Instead of Revert
Simpler fix: The issue is a missing condition check in the navigation logic
DeployBlocker - This typically applies to backend/Web deploys. Since this is purely a frontend navigation issue, this label may not be necessary, but I am leaving it for internal team review.
@marufsharifi - As the author of PR #79766, you may be best positioned to quickly implement a fix. The issue is in the navigation logic that needs to check for targetTransactionThreadReportID when both transactions are unreported expenses.
DeployBlockerCash - Correctly blocks the App (frontend) deploy until this is resolved
The fix should be straightforward - modify the navigation logic in src/pages/TransactionMerge/ConfirmationPage.tsx to check for targetTransactionThreadReportID when dismissing after a merge of unreported expenses.
Please re-state the problem that we are trying to solve in this issue.
After merging two unreported expenses in the Self DM, the user is navigated to the Self DM chat instead of the merged transaction thread. This is a regression introduced by PR #79766.
What is the root cause of that problem?
PR #79766 changed the reportID computation in src/pages/TransactionMerge/ConfirmationPage.tsx (line 74) to resolve UNREPORTED_REPORT_ID ('0') to the actual Self DM chat report ID via findSelfDMReportID(). This resolution was needed for the mergeTransactionRequest API call, but it unintentionally changed the downstream navigation logic.
The navigation flow after merge (lines 95-113) now takes a wrong path for unreported Self DM expenses:
reportID is resolved from '0' to the Self DM chat report ID (e.g. '123456')
reportIDToDismiss = '123456' (defined, since '123456' !== '0')
The condition reportIDToDismiss && reportID !== targetTransaction.reportID evaluates to true (since '123456' !== '0')
dismissModalWithReport({reportID: '123456'}) is called, which navigates to the Self DM chat view (r/123456), not the transaction thread
Before the PR, reportID stayed as '0', so reportIDToDismiss was undefined, and the code fell through to dismissToSuperWideRHP(), which correctly popped the RHP stack back to the expense view.
What changes do you think we should make in order to solve the problem?
In src/pages/TransactionMerge/ConfirmationPage.tsx, the non-search navigation path (line 108-111) should navigate to the transaction thread report instead of the parent report, similar to how the search path already prefers targetTransactionThreadReportID (line 97).
Change line 108-109 from:
if (reportIDToDismiss && reportID !== targetTransaction.reportID) {
Navigation.dismissModalWithReport({reportID: reportIDToDismiss});
to use targetTransactionThreadReportID when available:
This ensures that after merging unreported Self DM expenses, the user is navigated to the transaction thread (the expected behavior) rather than the Self DM chat room. When targetTransactionThreadReportID is not available, it falls back to reportIDToDismiss to preserve existing behavior for other cases.
What alternative solutions did you explore? (Optional)
Separate reportID for API vs navigation: Keep the findSelfDMReportID() resolution only for the mergeTransactionRequest call, and use the original mergeTransaction.reportID for navigation decisions. This would restore the old dismissToSuperWideRHP() path but would not address the broader goal of navigating to the correct transaction thread.
Revert the reportID resolution entirely: Simply revert the line 74 change. However, this would re-introduce the original issue that PR Fix incorrect chat opening after merging expense with self DM #79766 was fixing (incorrect chat opening after merging a workspace expense with a Self DM expense).
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Expense - Self DM opens instead of transaction thread after merging with unreported expenses[/-][+][$250] Expense - Self DM opens instead of transaction thread after merging with unreported expenses[/+]on Feb 23, 2026
Activity
melvin-bot commentedon Feb 23, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #79766
melvin-bot commentedon Feb 23, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 23, 2026
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Feb 23, 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 Feb 23, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #79766 - "Fix incorrect chat opening after merging expense with self DM" by @marufsharifi (High confidence)
Related Issues: #78842 (original issue that #79766 was fixing), #79275 (first attempt), #79505 (revert of #79275)
Recommendation: ROLL FORWARD
PR #79766 fixed one navigation issue but introduced a regression in a different scenario. The fix is straightforward and localized to the navigation logic. A revert would reintroduce the original bug (#78842), which affects a broader use case.
Labels: Both
DeployBlockerCashandDeployBlockerlabels should remain. This is a frontend bug that blocks the App deploy.📋 Detailed Analysis
Evidence
PR #79766 was merged on 2026-02-23 at 09:03:08Z and is included in staging deployment 9.3.25-0. The issue is reproducible on staging but NOT on production, which confirms the timing.
The PR modified
src/pages/TransactionMerge/ConfirmationPage.tsxto fix a navigation issue where merging a workspace expense with a self DM expense would incorrectly open the workspace chat instead of the self DM.However, the fix introduced a regression in a different scenario: when merging two unreported expenses (both in self DM), the navigation now opens the self DM instead of the transaction thread.
Verification
The bug is in the navigation logic in
src/pages/TransactionMerge/ConfirmationPage.tsx, specifically lines 108-111:When merging two self DM expenses:
reportID = CONST.REPORT.UNREPORTED_REPORT_IDmergeTransaction.reportIDto the actual self DM report IDreportIDToDismissbecomes the self DM report ID (line 95)reportID !== targetTransaction.reportIDevaluates toselfDMReportID !== UNREPORTED_REPORT_ID, which istrueRoot Cause
The navigation logic prioritizes dismissing to the merge destination report (self DM) without checking if there is a transaction thread that should be opened instead. The variable
targetTransactionThreadReportIDis calculated on line 60 but is not used in the non-search navigation path (lines 108-111).The fix should check if
targetTransactionThreadReportIDexists and navigate to it when both transactions are unreported expenses.Why Roll Forward Instead of Revert
OSBotify commentedon Feb 23, 2026
Label Recommendation
Based on the investigation:
src/pages/TransactionMerge/ConfirmationPage.tsx)Recommended labels:
DeployBlockerCash- KEEP (frontend App deploy blocker) ✓DeployBlocker- This typically applies to backend/Web deploys. Since this is purely a frontend navigation issue, this label may not be necessary, but I am leaving it for internal team review.@marufsharifi - As the author of PR #79766, you may be best positioned to quickly implement a fix. The issue is in the navigation logic that needs to check for
targetTransactionThreadReportIDwhen both transactions are unreported expenses.OSBotify commentedon Feb 23, 2026
Label Update
I have removed the
DeployBlockerlabel based on the following analysis:Why removed:
DeployBlockerlabel is specifically for backend/Web deploy issuesLabels retained:
DeployBlockerCash- Correctly blocks the App (frontend) deploy until this is resolvedThe fix should be straightforward - modify the navigation logic in
src/pages/TransactionMerge/ConfirmationPage.tsxto check fortargetTransactionThreadReportIDwhen dismissing after a merge of unreported expenses.MelvinBot commentedon Feb 23, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After merging two unreported expenses in the Self DM, the user is navigated to the Self DM chat instead of the merged transaction thread. This is a regression introduced by PR #79766.
What is the root cause of that problem?
PR #79766 changed the
reportIDcomputation insrc/pages/TransactionMerge/ConfirmationPage.tsx(line 74) to resolveUNREPORTED_REPORT_ID('0') to the actual Self DM chat report ID viafindSelfDMReportID(). This resolution was needed for themergeTransactionRequestAPI call, but it unintentionally changed the downstream navigation logic.The navigation flow after merge (lines 95-113) now takes a wrong path for unreported Self DM expenses:
reportIDis resolved from'0'to the Self DM chat report ID (e.g.'123456')reportIDToDismiss='123456'(defined, since'123456' !== '0')reportIDToDismiss && reportID !== targetTransaction.reportIDevaluates totrue(since'123456' !== '0')dismissModalWithReport({reportID: '123456'})is called, which navigates to the Self DM chat view (r/123456), not the transaction threadBefore the PR,
reportIDstayed as'0', soreportIDToDismisswasundefined, and the code fell through todismissToSuperWideRHP(), which correctly popped the RHP stack back to the expense view.What changes do you think we should make in order to solve the problem?
In
src/pages/TransactionMerge/ConfirmationPage.tsx, the non-search navigation path (line 108-111) should navigate to the transaction thread report instead of the parent report, similar to how the search path already preferstargetTransactionThreadReportID(line 97).Change line 108-109 from:
to use
targetTransactionThreadReportIDwhen available:This ensures that after merging unreported Self DM expenses, the user is navigated to the transaction thread (the expected behavior) rather than the Self DM chat room. When
targetTransactionThreadReportIDis not available, it falls back toreportIDToDismissto preserve existing behavior for other cases.What alternative solutions did you explore? (Optional)
Separate
reportIDfor API vs navigation: Keep thefindSelfDMReportID()resolution only for themergeTransactionRequestcall, and use the originalmergeTransaction.reportIDfor navigation decisions. This would restore the olddismissToSuperWideRHP()path but would not address the broader goal of navigating to the correct transaction thread.Revert the
reportIDresolution entirely: Simply revert the line 74 change. However, this would re-introduce the original issue that PR Fix incorrect chat opening after merging expense with self DM #79766 was fixing (incorrect chat opening after merging a workspace expense with a Self DM expense).Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Feb 23, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (
External)[-]Expense - Self DM opens instead of transaction thread after merging with unreported expenses[/-][+][$250] Expense - Self DM opens instead of transaction thread after merging with unreported expenses[/+]melvin-bot commentedon Feb 23, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026068707359737023
rojiphil commentedon Feb 24, 2026
This doesn't look like a bug as that is what we implemented in #79766 (Test 1) as per this comment
cc @joekaufmanexpensify @MonilBhavsar
MonilBhavsar commentedon Feb 24, 2026
Feature and not a bug