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-08-20] [$250] mWeb- LHN - Double chat messages when move expense to other workspace #65561
Version Number: v9.1.77-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:#65310 Email or phone of affected tester (no customers):gocemate+b2153682approver@gmail.com Issue reported by: Applause Internal Team Device used: Samsung Galaxy A02s/12 App Component: Left Hand Navigation (LHN)
Action Performed:
Precondition:
Create a workspace with Admin, Approver and Member.
Steps
Go to the app
[Member] Submit an expense in the workspace chat.
[Member] Click Submit on the expense preview.
[Approver] Create a new workspace.
[Approver] Open workspace chat with member.
[Approver] Open the expense report.
[Approver] Click More > Change workspace.
[Approver] Select the new workspace.
[Approver] Open the workspace chat with member from Step 5.
Expected Result:
There should be only one message " User owes..."
Actual Result:
Double chat messages when move expense to other workspace
This logic creates a new REPORT_PREVIEW report action and adds it to the policy expense chat. However, we are always adding it to the current user's policy expense chat, instead of the policy expense chat of the user who owns the expense report (optimistically).
Meanwhile, the backend also creates a new REPORT_PREVIEW report action, but it correctly adds it to the policy expense chat of the actual owner of the expense report.
As a result, the "User owes..." message appears twice in the LHN.
What changes do you think we should make in order to solve the problem?
// 3. Optimistically create a new REPORT_PREVIEW reportAction with the newReportPreviewActionID
// and set it as a parent of the moved report
const policyExpenseChat = optimisticPolicyExpenseChatReport ?? getPolicyExpenseChat(report.ownerAccountID, policyID);
const optimisticReportPreviewAction = buildOptimisticReportPreview(policyExpenseChat, report);
const newPolicyExpenseChatReportID = policyExpenseChat?.reportID;
changed the title [-]mWeb- LHN - Double chat messages when move expense to other workspace[/-][+][$250] mWeb- LHN - Double chat messages when move expense to other workspace[/+]on Jul 8, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.93-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@DylanDylann / @truph01@sonialiap 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:
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jul 7, 2025
Triggered auto assignment to @sonialiap (
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.truph01 commentedon Jul 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/libs/actions/Report.ts
Lines 5575 to 5586 in 46b6aef
This logic creates a new
REPORT_PREVIEWreport action and adds it to the policy expense chat. However, we are always adding it to the current user's policy expense chat, instead of the policy expense chat of the user who owns the expense report (optimistically).Meanwhile, the backend also creates a new
REPORT_PREVIEWreport action, but it correctly adds it to the policy expense chat of the actual owner of the expense report.As a result, the "User owes..." message appears twice in the LHN.
What changes do you think we should make in order to solve the problem?
App/src/libs/actions/Report.ts
Line 5451 in 46b6aef
Introduce a third parameter:
optimisticPolicyExpenseChatReport?: Report. This will help handle two cases:App/src/libs/actions/Report.ts
Lines 5575 to 5580 in 46b6aef
Update it as follows:
App/src/libs/actions/Report.ts
Line 5713 in 46b6aef
pass
membersChats.reportCreationData[submitterEmail]as 3rd param.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
[-]mWeb- LHN - Double chat messages when move expense to other workspace[/-][+][$250] mWeb- LHN - Double chat messages when move expense to other workspace[/+]melvin-bot commentedon Jul 8, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021942581813581610068
melvin-bot commentedon Jul 8, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)melvin-bot commentedon Jul 11, 2025
@DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
sonialiap commentedon Jul 15, 2025
@DylanDylann have you had a chance to review the proposal?
23 remaining items
melvin-bot commentedon Aug 13, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 13, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.93-7 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-08-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Aug 13, 2025
@DylanDylann / @truph01 @sonialiap 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]
sonialiap commentedon Aug 22, 2025
Payment summary:
DylanDylann commentedon Aug 25, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: Feature: Implement ChangeReportPolicy #57553 (comment)
[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:
[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.
[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/540281
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
garrettmknight commentedon Oct 24, 2025
$250 approved for @DylanDylann