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-31] [$250] Self DM chat appears briefly when open chat with secondary login #75956
changed the title [-]Self DM chat appears briefly when open chat with secondary login[/-][+][$250] Self DM chat appears briefly when open chat with secondary login[/+]on Nov 26, 2025
to check if a login belongs to the current user's loginList before generating an optimistic ID. If the login is found in loginList, use currentUserAccountID instead.
allowing getChatByParticipants() to find the existing chat instead of creating a new optimistic Self DM.
@TaduJR The issue happens when you search other user's secondary login. It's expected that an optimistic report will be created and later be redirected to the primary user login's report. The problem here is the secondary login's report shows the current user information.
So, there's only one participant, the current user, left in report.participants. The current user participant should only be used when it's self DM chat but there's a bug in method isOneOnOneChat when participantAmount is 0
What alternative solutions did you explore? (Optional)
We should figure out a better mechanism to update report data for this use case
openReport with a new chat, which BE returns info to redirect to preexistingReportID
openReport with preexistingReportID
The current implementation clean up optimistic report participant data after the first request is returned, there's a timing issue before the second request succeeded.
I think a potential better solution is to clean up optimistic report and participant data after the second request is returned. But it's more complex to coordinate and we don't have this pattern in the App. That said, I think we can use the main solution at the moment.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.86-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@bernhardoj / @eh2077@strepanier03 The PR fixing this issue has been merged! 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]
[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.
Activity
melvin-bot commentedon Nov 25, 2025
Triggered auto assignment to @strepanier03 (
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.[-]Self DM chat appears briefly when open chat with secondary login[/-][+][$250] Self DM chat appears briefly when open chat with secondary login[/+]melvin-bot commentedon Nov 26, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021993529348918579912
melvin-bot commentedon Nov 26, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @bernhardoj (
External)bernhardoj commentedon Nov 26, 2025
@TaduJR The issue happens when you search other user's secondary login. It's expected that an optimistic report will be created and later be redirected to the primary user login's report. The problem here is the secondary login's report shows the current user information.
bernhardoj commentedon Nov 28, 2025
Posted in Slack to get more proposals...
TaduJR commentedon Nov 28, 2025
Hey @bernhardoj
Thank you for your review.
Unfortunately, I am having blockers on another PR, need to focus on that one.
Withdrawing Proposal.
eh2077 commentedon Dec 1, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Self DM chat appears when a new chat redirect to an existing chat.
What is the root cause of that problem?
The root cause of this issue is that we clear optimistic participant when creating a new chat report
App/src/libs/actions/Report.ts
Lines 1268 to 1274 in fbed79d
So, there's only one participant, the current user, left in report.participants. The current user participant should only be used when it's self DM chat but there's a bug in method
isOneOnOneChatwhenparticipantAmountis 0App/src/libs/ReportUtils.ts
Lines 2607 to 2614 in fbed79d
App/src/libs/ReportUtils.ts
Line 3310 in fbed79d
App/src/pages/home/HeaderView.tsx
Line 130 in fbed79d
Same issue happens when the open a new chat request redirects an preexistingReportID which is unknown at client, see here
App/src/libs/actions/Report.ts
Lines 1875 to 1881 in fbed79d
What changes do you think we should make in order to solve the problem?
The most intuitive fix will be in method
isOneOnOneChatApp/src/libs/ReportUtils.ts
Lines 2607 to 2614 in fbed79d
What alternative solutions did you explore? (Optional)
We should figure out a better mechanism to update report data for this use case
The current implementation clean up optimistic report participant data after the first request is returned, there's a timing issue before the second request succeeded.
I think a potential better solution is to clean up optimistic report and participant data after the second request is returned. But it's more complex to coordinate and we don't have this pattern in the App. That said, I think we can use the main solution at the moment.
44 remaining items
melvin-bot commentedon Dec 24, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Dec 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.86-4 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 2025-12-31. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 24, 2025
@bernhardoj / @eh2077 @strepanier03 The PR fixing this issue has been merged! 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]
bernhardoj commentedon Dec 26, 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: https://github.com/Expensify/App/pull/70240/files#r2647352243
[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: https://github.com/Expensify/Expensify/issues/583081
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-81ff-a333-9fc4-2fe9bb3bc234strepanier03 commentedon Dec 30, 2025
Payment summary
For: #77885
bernhardoj commentedon Dec 31, 2025
Requested in ND.
garrettmknight commentedon Jan 5, 2026
$250 approved for @bernhardoj
JmillsExpensify commentedon Jan 8, 2026
$250 approved for @eh2077