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 - Different destination opens when bulk merging vs merging individually #83257
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: Pull Request QA execution Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Create an expense in self DM.
Create an expense in workspace chat.
Go to Reports > Expenses.
Open the workspace expense.
Click More > Merge.
Select self DM expense > Continue.
Select second option in each section > Next > Merge expenses.
→ Transaction thread opens.
Create an expense in self DM.
Create an expense in workspace chat.
Go to Reports > Expenses.
Select workspace expense via checkbox.
Click dropdown button > Merge.
Select self DM expense > Continue.
Select second option in each section > Next > Merge expenses.
Expected Result:
Transaction thread will open after merging expenses via bulk option (similar to Step 8).
Actual Result:
Self DM opens after merging expenses via bulk option.
👋 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
Recommendation: REVERT
PR #79766 introduced a regression in bulk merge navigation. While it fixed individual merge navigation, it broke bulk merge by causing it to navigate to the parent chat instead of the transaction thread.
Labels: Keeping DeployBlockerCash (App PR caused the issue), removing DeployBlocker (not a backend issue)
📋 Detailed Analysis
Evidence
PR #79766 was merged on 2026-02-23 (same day as this deploy blocker was reported) and is listed in the StagingDeployCash issue #83247. The PR modified src/pages/TransactionMerge/ConfirmationPage.tsx to change how navigation works after merging expenses, specifically to handle self DM expense merges.
The issue report explicitly states:
Individual merge (steps 1-8): Works correctly - transaction thread opens
This matches the scope of changes in PR #79766, which modified the navigation logic in the confirmation page.
Verification
PR #79766 modified only one file: src/pages/TransactionMerge/ConfirmationPage.tsx
The key changes were:
Line 74: Added logic to determine reportID - if merge transaction reportID is UNREPORTED_REPORT_ID, it falls back to self DM report ID
Lines 97-105: Changed navigation logic to use ROUTES.SEARCH_REPORT for all search-based merges
Root Cause
When bulk merging from search (Reports > Expenses), the flow has isOnSearch = true. The PR changed the navigation to always use ROUTES.SEARCH_REPORT for search-based merges.
The problem occurs when:
User selects workspace expense (target transaction)
If targetTransactionThreadReportID is undefined or not properly set, the navigation falls back to reportIDToDismiss (self DM report ID), causing navigation to the self DM chat instead of the transaction thread.
The issue is that the navigation logic does not properly prioritize the transaction thread for bulk merges when the selected reportID is unreported.
@MelvinBot Please review this issue afresh and the reference PR #96633.
If there are any pending implementation gaps in the PR, suggest any further needed changes.
Also, generate indexed test steps to verify the coverage of the fix.
This was a static code review; the steps below are proposed coverage, not newly executed tests.
Review findings
What is the root cause of the remaining problems?
A known thread ID can still bypass offline seeding.
Confirmation only resolves snapshot context when the thread ID is missing. If the transaction already supplies an ID but its report and parent action are absent from Onyx, navigation retains the ID while the merge action loses it. The thread-seeding branch is then skipped.
Rollback can delete unrelated thread actions.
The missing-report branch replaces the entire thread-action collection; failure subsequently deletes it wholesale. Existing actions—or an offline comment added after merging—can be removed rather than just undoing the merge’s placeholder.
Moving the workspace expense to self-DM can skip emptied-report cleanup.
Original workspace-report/preview cleanup sits inside a branch skipped when the deleted source is unreported and self-DM exists. Consequently, the old report and preview remain in optimistic state. This does not establish that the old amount remains visibly rendered.
Pass the resolved thread ID explicitly into the merge action. Resolve missing report/action context independently of whether that ID exists.
Preserve existing thread actions; insert/remove only the synthetic placeholder. Ensure rollback preserves independently queued comments and their state.
Separate emptied workspace-report/preview cleanup from source-expense deletion, with corresponding rollback.
Add integration coverage for the confirmation-page-to-action handoff, not only direct action-helper tests.
The latest offline wrong-amount report remains unverified. The selected amount already reaches the newly created destination action, so another generic amount/sign change is not justified. Reproduce it while recording whether the incorrect value appears in the expense details, thread title, report total, or workspace preview, and which destination was selected.
Indexed verification steps
Preparation: Use fresh manual expenses with the same currency but deliberately different amounts: workspace 25, self-DM 60, with distinguishable merchants.
Original bulk flow, online: Create self-DM first, then workspace expense. Open Spend → Expenses → select workspace checkbox → Merge → select self-DM expense → Continue → choose the self-DM values → finish. Verify the merged transaction thread opens, not “Your space,” showing 60.
Individual flow, online: Repeat from the workspace expense’s More → Merge menu. Verify the same destination, amount, and merchant as step 1.
Offline bulk flow: Repeat step 1, disconnecting after loading Spend. Verify populated expense details open without an indefinite skeleton.
Two-checkbox flow: Offline, select both expenses in Spend, then Merge. Choose the self-DM values. Verify the same result as step 3.
Latest reported amount case: Offline, start from a single-expense report in workspace chat. Select the unreported expense’s amount. Run separately with self-DM and workspace destinations. Verify every applicable detail, thread title, card, and report total shows 60, not 25.
Creation-order variation: Repeat steps 3–5 with workspace created first. Verify results do not depend on creation order; the removed expense must not remain selected or reappear as an active duplicate.
Thread-cache variations: Repeat offline with an opened/cached thread and a never-opened thread. Add automated fixtures for an existing thread ID with a missing/partial report, both with and without snapshot report data. Verify the existing ID is reused and fully seeded.
Original-report cleanup: After moving the workspace expense to self-DM, return to workspace chat. Verify its emptied single-expense report/preview is removed rather than left stale.
Split regression: Merge a workspace manual expense with an eligible split expense through Spend. Verify the correct merged thread opens and displays the selected values.
Reconnect and refresh: Reconnect after each offline destination case, let requests finish, then reload. Verify one surviving expense, unchanged selected values, working thread navigation, and no duplicate placeholder cards.
Failure/rollback: In an automated failure fixture, reject the merge after adding an offline comment to the opened thread. Verify original expenses, amounts, reports, and previews are restored without deleting that comment or pre-existing actions.
Shared loading regression: Open ordinary cached chats and expense reports offline. Verify usable content still renders; check actual console output separately for JavaScript errors.
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 @jliexpensify (
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
Recommendation: REVERT
PR #79766 introduced a regression in bulk merge navigation. While it fixed individual merge navigation, it broke bulk merge by causing it to navigate to the parent chat instead of the transaction thread.
Labels: Keeping
DeployBlockerCash(App PR caused the issue), removingDeployBlocker(not a backend issue)📋 Detailed Analysis
Evidence
PR #79766 was merged on 2026-02-23 (same day as this deploy blocker was reported) and is listed in the StagingDeployCash issue #83247. The PR modified
src/pages/TransactionMerge/ConfirmationPage.tsxto change how navigation works after merging expenses, specifically to handle self DM expense merges.The issue report explicitly states:
This matches the scope of changes in PR #79766, which modified the navigation logic in the confirmation page.
Verification
PR #79766 modified only one file:
src/pages/TransactionMerge/ConfirmationPage.tsxThe key changes were:
Root Cause
When bulk merging from search (Reports > Expenses), the flow has isOnSearch = true. The PR changed the navigation to always use ROUTES.SEARCH_REPORT for search-based merges.
The problem occurs when:
The code calculates:
If targetTransactionThreadReportID is undefined or not properly set, the navigation falls back to reportIDToDismiss (self DM report ID), causing navigation to the self DM chat instead of the transaction thread.
The issue is that the navigation logic does not properly prioritize the transaction thread for bulk merges when the selected reportID is unreported.
127 remaining items
melvin-bot commentedon Oct 9, 2026
@rojiphil, @mallenexpensify, @MonilBhavsar, @marufsharifi, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
Kabeer099 commentedon Oct 29, 2026
melvin-bot commentedon Nov 6, 2026
@rojiphil Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Nov 10, 2026
@rojiphil Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Nov 12, 2026
@rojiphil Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
mallenexpensify commentedon Nov 13, 2026
@rojiphil please wrap this up with Melvin, if possible. If not, post in #contributor-plus to ask for help from a C+. Thx
huult commentedon Nov 14, 2026
I can help as a C+ if needed.
aimane-chnaif commentedon Nov 14, 2026
If contributor is preferred over Melvin, I'll help as per https://expensify.slack.com/archives/C02NK2DQWUX/p1794598366148089?thread_ts=1794596568.884299&cid=C02NK2DQWUX
rojiphil commentedon Nov 14, 2026
@MelvinBot Please review this issue afresh and the reference PR #96633.
If there are any pending implementation gaps in the PR, suggest any further needed changes.
Also, generate indexed test steps to verify the coverage of the fix.
MelvinBot commentedon Nov 14, 2026
Reviewed Fix merge expense transaction thread navigation at
911eb7e. There are still implementation gaps worth addressing in the replacement PR. The reference PR is closed, not merged.This was a static code review; the steps below are proposed coverage, not newly executed tests.
Review findings
What is the root cause of the remaining problems?
A known thread ID can still bypass offline seeding.
Confirmation only resolves snapshot context when the thread ID is missing. If the transaction already supplies an ID but its report and parent action are absent from Onyx, navigation retains the ID while the merge action loses it. The thread-seeding branch is then skipped.
Rollback can delete unrelated thread actions.
The missing-report branch replaces the entire thread-action collection; failure subsequently deletes it wholesale. Existing actions—or an offline comment added after merging—can be removed rather than just undoing the merge’s placeholder.
Moving the workspace expense to self-DM can skip emptied-report cleanup.
Original workspace-report/preview cleanup sits inside a branch skipped when the deleted source is unreported and self-DM exists. Consequently, the old report and preview remain in optimistic state. This does not establish that the old amount remains visibly rendered.
Code evidence
What further changes are needed?
The latest offline wrong-amount report remains unverified. The selected amount already reaches the newly created destination action, so another generic amount/sign change is not justified. Reproduce it while recording whether the incorrect value appears in the expense details, thread title, report total, or workspace preview, and which destination was selected.
Indexed verification steps
Preparation: Use fresh manual expenses with the same currency but deliberately different amounts: workspace 25, self-DM 60, with distinguishable merchants.
Original bulk flow, online: Create self-DM first, then workspace expense. Open Spend → Expenses → select workspace checkbox → Merge → select self-DM expense → Continue → choose the self-DM values → finish. Verify the merged transaction thread opens, not “Your space,” showing 60.
Individual flow, online: Repeat from the workspace expense’s More → Merge menu. Verify the same destination, amount, and merchant as step 1.
Offline bulk flow: Repeat step 1, disconnecting after loading Spend. Verify populated expense details open without an indefinite skeleton.
Two-checkbox flow: Offline, select both expenses in Spend, then Merge. Choose the self-DM values. Verify the same result as step 3.
Latest reported amount case: Offline, start from a single-expense report in workspace chat. Select the unreported expense’s amount. Run separately with self-DM and workspace destinations. Verify every applicable detail, thread title, card, and report total shows 60, not 25.
Creation-order variation: Repeat steps 3–5 with workspace created first. Verify results do not depend on creation order; the removed expense must not remain selected or reappear as an active duplicate.
Thread-cache variations: Repeat offline with an opened/cached thread and a never-opened thread. Add automated fixtures for an existing thread ID with a missing/partial report, both with and without snapshot report data. Verify the existing ID is reused and fully seeded.
Original-report cleanup: After moving the workspace expense to self-DM, return to workspace chat. Verify its emptied single-expense report/preview is removed rather than left stale.
Split regression: Merge a workspace manual expense with an eligible split expense through Spend. Verify the correct merged thread opens and displays the selected values.
Reconnect and refresh: Reconnect after each offline destination case, let requests finish, then reload. Verify one surviving expense, unchanged selected values, working thread navigation, and no duplicate placeholder cards.
Failure/rollback: In an automated failure fixture, reject the merge after adding an offline comment to the opened thread. Verify original expenses, amounts, reports, and previews are restored without deleting that comment or pre-existing actions.
Shared loading regression: Open ordinary cached chats and expense reports offline. Verify usable content still renders; check actual console output separately for JavaScript errors.
view run