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 2025-12-26] [$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense #74793
Version Number: v9.2.48-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176730/test-cases/41237113 Email or phone of affected tester (no customers):htad26+gdfdd@gmail.com Issue reported by: Applause Internal Team Device used: iOS 26.1/iPhone 13 App Component: Left Hand Navigation (LHN)
Action Performed:
Log in to the app with a new account
During on boarding, choose any onboarding intent except track expense > Finsh the flow
Create a new workspace > Submit an expense to the workspace
What changes do you think we should make in order to solve the problem?
Define a new parameter selfDMReportID and set it as the optimistic selfDM's reportID. Then the backend will use this to generate the selfDM report. With this we can ensure the optimistic selfDM and the report is created from the backend is the same.
We can also define selfDMCreatedReportActionID for the created action of the selfDM like we do when deleting the app report
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/-][+][$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/+]on Nov 17, 2025
changed the title [-][Due for payment 2025-12-23] [$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/-][+][Due for payment 2025-12-26] [$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/+]on Dec 22, 2025
Due to the regression, the new payment date is set for 12/26. The team will be OoO for the holidays, but I will be working 12/29, so will get that paid then 👍
@bernhardoj can you make sure the checklist is completed before that time? Thanks!
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - I think this is more likely caused by a BE change. Before, if there is no self DM report found, then it means the report doesn't exist on the BE, too. But now, the self DM is always created on the BE, but the FE could not have the self DM report data, and only have the self DM report ID.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
N/A
Test:
Log in to the app with a new account
During onboarding, choose any onboarding intent except track expense > Finish the flow
Create a new workspace if there is no workspace yet
Activity
melvin-bot commentedon Nov 11, 2025
Triggered auto assignment to @CortneyOfstad (
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.dmkt9 commentedon Nov 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Duplicate Self DM chats are displayed in the LHN.
What is the root cause of that problem?
A new optimistic
selfDMchat is created if it doesn't already exist:App/src/libs/actions/Transaction.ts
Lines 681 to 683 in c51a657
However, when
CHANGE_TRANSACTIONS_REPORTsucceeds, the server returns aselfDMchat with a newreportID, resulting in twoselfDMchats.What changes do you think we should make in order to solve the problem?
We should remove the optimistic
selfDMchat regardless of whetherCHANGE_TRANSACTIONS_REPORTsucceeds or fails.App/src/libs/actions/Transaction.ts
Lines 712 to 755 in c51a657
finallyData.push( { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${selfDMReport.reportID}`, value: null, }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${selfDMReport.reportID}`, value: null, }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${selfDMReport.reportID}`, value: null, }, );App/src/libs/actions/Transaction.ts
Line 1289 in c51a657
failureData, + finallyData,What alternative solutions did you explore? (Optional)
N/A
nkdengineer commentedon Nov 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Duplicate Self DM chats are displayed in the LHN.
What is the root cause of that problem?
A
selfDMis created in optimistic data and then the backend returns anotherselfDMwith the differentreportIDApp/src/libs/actions/Transaction.ts
Lines 681 to 683 in c51a657
What changes do you think we should make in order to solve the problem?
Define a new parameter
selfDMReportIDand set it as the optimistic selfDM's reportID. Then the backend will use this to generate theselfDMreport. With this we can ensure the optimistic selfDM and the report is created from the backend is the same.We can also define
selfDMCreatedReportActionIDfor the created action of the selfDM like we do when deleting the app reportApp/src/libs/actions/Report.ts
Lines 5092 to 5096 in 48f5093
App/src/libs/actions/Transaction.ts
Line 1280 in c51a657
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Nov 15, 2025
@CortneyOfstad Whoops! This issue is 2 days overdue. Let's get this updated quick!
CortneyOfstad commentedon Nov 17, 2025
Getting eyes!
melvin-bot commentedon Nov 17, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021990518500162133460
[-]LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/-][+][$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/+]48 remaining items
nkdengineer commentedon Dec 17, 2025
@bernhardoj The PR is ready for review.
bernhardoj commentedon Dec 17, 2025
Just a note that the PR was reverted because of an issue that happens after this PR is merged on the same day as our PR.
[-][Due for payment 2025-12-23] [$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/-][+][Due for payment 2025-12-26] [$250] LHN - Duplicate Self DM chat displayed in LHN after unreporting an expense[/+]CortneyOfstad commentedon Dec 22, 2025
Due to the regression, the new payment date is set for 12/26. The team will be OoO for the holidays, but I will be working 12/29, so will get that paid then 👍
@bernhardoj can you make sure the checklist is completed before that time? Thanks!
bernhardoj commentedon Dec 23, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - I think this is more likely caused by a BE change. Before, if there is no self DM report found, then it means the report doesn't exist on the BE, too. But now, the self DM is always created on the BE, but the FE could not have the self DM report data, and only have the self DM report ID.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
N/A
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Dec 26, 2025
Payment Summary
Upwork Job
BugZero Checklist (@CortneyOfstad)
CortneyOfstad commentedon Dec 29, 2025
Payment Summary
@bernhardoj — to be paid $250 via NewDot
@nkdengineer — to be paid $250 via NewDot
Regression Test
https://github.com/Expensify/Expensify/issues/582613
bernhardoj commentedon Dec 30, 2025
Requested in ND.
garrettmknight commentedon Jan 5, 2026
$250 approved for @bernhardoj
twisterdotcom commentedon Jan 12, 2026
@nkdengineer has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-52a2-a763-a28b-a4dcedd35914