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-07-30] [$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace #65323
Version Number: 9.1.74-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/6414864 Email or phone of affected tester (no customers):siojsduhsbsuid@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
User A has a workspace.
Go to staging.expensify.com
[User A] Submit an expense to User B.
[User B} Submit an expense (any amount) to User A.
[User A] Open the expense report.
[User A] Delete the submitted expense from Step 2.
[User A] Click More > Change workspace.
[User A] Select any workspace.
Expected Result:
IOU will be moved to the workspace.
Actual Result:
Change workspace button is not responsive when submitter deletes own expense and tries to change workspace.
When checking if the manager of iouReport has submitted an expense to the same report, we are not considering if the report action is deleted here. Therefore the deleted report action will be counted an existing report action, and we return early.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add test for hasRequestFromCurrentAccount to assert that it returns false when the report action is deleted and it return true when the report action is not deleted
What alternative solutions did you explore? (Optional)
We can create a custom function to check if iou report manager has submitted to the same report if think changing the existing function breaks any existing functionality
But the check hasRequestFromCurrentAccount doesn't work as expected. After user A deletes your transaction, the iou action still exists, it's only marked as deleted then this function returns true.
* Constructs a message for an actionable mention whisper report action.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should add a unit test for hasRequestFromCurrentAccount function to verify it works correctly if the list action contains the deleted iou action and prevent the same bug from happening in the feature.
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 [-]Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/-][+][$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/+]on Jul 2, 2025
but the way we are checking is via hasRequestFromCurrentAccount for the manager (if the manager of the iou has request) and even if the request from the manager is deleted in the OP, it doesn't properly account for deleted iou actions
* Constructs a message for an actionable mention whisper report action.
What changes do you think we should make in order to solve the problem?
By the way, what we want to prevent is moving iou report's to policy which have expense from multiple users because we don't want to create negative amount expenses
Checking for IOU actions is not a reliable way to determine this as there are otherIOU which are not linked to a request, for instance, payed action that is created when you create an iou report is also IOU type report action. So the correct way to determine is to check if there are transactions with negative amount like here
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
If needed can test moveIOUReportToPolicyAndInviteSubmitter properly moves iou report when there is a deleted iou action from the manager of the iou report.
What alternative solutions did you explore? (Optional)
changed the title [-][$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/-][+][Due for payment 2025-07-30] [$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/+]on Jul 23, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.84-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Pujan92@sakluger 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.
[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:
User A has a workspace.
[User A] Submit an expense to User B.
[User B] Submit an expense to User A.
[User A] Open the expense report.
[User A] Delete the submitted expense from Step 2.
[User A] Click More > Change workspace.
[User A] Select any workspace.
[User A] Verify that the expense is moved to the workspace
Activity
melvin-bot commentedon Jul 2, 2025
Triggered auto assignment to @sakluger (
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.etCoderDysto commentedon Jul 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Nothing happens when submitter deletes own expense and clicks Change workspace
What is the root cause of that problem?
We return early in moveIOUReportToPolicyAndInviteSubmitter, if the manager of an iou has also submitted an IOU in the same money request report
App/src/libs/actions/Report.ts
Lines 5164 to 5166 in cec17ac
When checking if the manager of iouReport has submitted an expense to the same report, we are not considering if the report action is deleted here. Therefore the deleted report action will be counted an existing report action, and we return early.
App/src/libs/ReportActionsUtils.ts
Lines 1830 to 1840 in cec17ac
What changes do you think we should make in order to solve the problem?
We should check if the report action is deleted
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add test for hasRequestFromCurrentAccount to assert that it returns false when the report action is deleted and it return true when the report action is not deleted
What alternative solutions did you explore? (Optional)
We can create a custom function to check if iou report manager has submitted to the same report if think changing the existing function breaks any existing functionality
}
nkdengineer commentedon Jul 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Change workspace button is not responsive when submitter deletes own expense and tries to change workspace.
What is the root cause of that problem?
We return early if the iou report has the request from the current user.
App/src/libs/actions/Report.ts
Lines 5164 to 5166 in cec17ac
App/src/libs/actions/Report.ts
Lines 4982 to 4985 in cec17ac
But the check
hasRequestFromCurrentAccountdoesn't work as expected. After user A deletes your transaction, the iou action still exists, it's only marked as deleted then this function returnstrue.App/src/libs/ReportActionsUtils.ts
Lines 1830 to 1844 in cec17ac
What changes do you think we should make in order to solve the problem?
We should filter out the deleted action
App/src/libs/ReportActionsUtils.ts
Lines 1830 to 1844 in cec17ac
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should add a unit test for
hasRequestFromCurrentAccountfunction to verify it works correctly if the list action contains the deleted iou action and prevent the same bug from happening in the feature.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.
[-]Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/-][+][$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/+]melvin-bot commentedon Jul 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021940551797202659919
melvin-bot commentedon Jul 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)FitseTLT commentedon Jul 4, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Nothing happens when submitter deletes own expense and clicks Change workspace
What is the root cause of that problem?
We can't move iou report to a workspace if the iou report has expenses from mutltiple users
App/src/libs/actions/Report.ts
Lines 5163 to 5166 in cec17ac
but the way we are checking is via
hasRequestFromCurrentAccountfor the manager (if the manager of the iou has request) and even if the request from the manager is deleted in the OP, it doesn't properly account for deleted iou actionsApp/src/libs/ReportActionsUtils.ts
Lines 1830 to 1844 in cec17ac
What changes do you think we should make in order to solve the problem?
By the way, what we want to prevent is moving iou report's to policy which have expense from multiple users because we don't want to create negative amount expenses
App/src/libs/actions/Report.ts
Lines 4976 to 4977 in 74e1436
Checking for
IOUactions is not a reliable way to determine this as there are otherIOUwhich are not linked to a request, for instance, payed action that is created when you create an iou report is alsoIOUtype report action. So the correct way to determine is to check if there are transactions with negative amount like hereApp/src/libs/ReportSecondaryActionUtils.ts
Lines 402 to 403 in 74e1436
App/src/libs/ReportUtils.ts
Lines 10841 to 10844 in 74e1436
App/src/libs/ReportUtils.ts
Lines 10829 to 10832 in 74e1436
which is the condition we used to determine if we can display change workspace option in the more options.
So we should update both to the condition consistent with the above
App/src/libs/actions/Report.ts
Lines 4976 to 4980 in 74e1436
App/src/libs/actions/Report.ts
Lines 5158 to 5162 in 74e1436
Additionally, we can still update
hasRequestFromCurrentAccountto take account of deleted iou actions because we still use it in another place.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
If needed can test
moveIOUReportToPolicyAndInviteSubmitterproperly moves iou report when there is a deleted iou action from the manager of the iou report.What alternative solutions did you explore? (Optional)
21 remaining items
[-][$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/-][+][Due for payment 2025-07-30] [$250] Expense - Nothing happens when submitter deletes own expense and clicks Change workspace[/+]melvin-bot commentedon Jul 23, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 23, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.84-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-07-30. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 23, 2025
@Pujan92 @sakluger 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]
Pujan92 commentedon Jul 31, 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: https://github.com/Expensify/App/pull/58078/files#r2245296227
[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.
[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:
Do we agree 👍 or 👎
sakluger commentedon Jul 31, 2025
Payment Summary
Contributor: @etCoderDysto paid $250 via Upwork
Contributor+: @Pujan92 request $250 via Newdot
garrettmknight commentedon Aug 1, 2025
$250 approved for @Pujan92
isabelastisser commentedon Aug 5, 2025
@Pujan92 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Vendor found in VML: True. Status: Active
Amount requested: $250.00 (Matches the payment summary here.
I am not already the BZ assignee. I have approved this payment.