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-01] [$250] Expense- "changed the workspace to" message becomes incomplete after leaving workspaces #64167
Version Number: 9.1.66-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):sdhdsnjoidjsojo2@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
User is invited to three workspaces - A, B and C.
Go to staging.new.expensify.com
Go to workspace chat A.
Submit an expense to the workspace chat.
Go to expense report.
Click More > Change workspace.
Select workspace B.
Click More > Change workspace.
Select workspace C.
Leave workspace A and B.
Go back to the expense report.
Expected Result:
"changed the workspace to" system message should read "changed the workspace".
Actual Result:
"changed the workspace to" system message becomes incomplete when user is no longer part of the involved workspaces.
`changed the workspace to ${toPolicyName}${fromPolicyName ? ` (previously ${fromPolicyName})` : ''}`,
What changes do you think we should make in order to solve the problem?
The lack of info is expected in the case of the wokspace deletion from onyx due to leaving workspace or deletion but our copy should treat that properly like we did for changedTransaction here
movedTransaction: ({reportUrl, reportName}: MovedTransactionParams)=>`moved this expense${reportName ? ` to <a href="${reportUrl}">${reportName}</a>` : ''}`,
the to should only be displayed if the policy name exists other wise we should display a generic message of sth like changed the workspace like this
`changed the workspace${toPolicyName ? ` to ${toPolicyName}${fromPolicyName ? ` (previously ${fromPolicyName})` : ''}` : ''}`,
But any general message can be suggested by the copy team. Because there might be several variations of the copy like if the toPolicy name doesnt exist but the fromPolicy name exists we can consider another copy which mentions the previous policy name but jumps the toPolicy name with a general text.
Alternatively as the workspace id is always available we can display workspace #ID message but we need to discuss it with design team.
If we can update the BE of course we can incorporate the policy names in the original messages of the actions and we can use them as a back up when we can't calculate it in the FE.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
If needed might add a test for getPolicyChangeMessage to cover this case of the policy not existing in onyx and the result depends on the method we are going to use to deal with the problem.
What alternative solutions did you explore? (Optional)
Though a bit costly, we can find (search) in allReports for an archived report linked to the policy and use the report's oldPolicyName prop to get the name but no report can still be found linked to the policy and the above update of the copy is mandatory I think.
🚨 Edited by proposal-police: This proposal was edited at 2025-06-13 13:13:11 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
"changed the workspace to" message becomes incomplete after leaving workspaces
What is the root cause of that problem?
We call getPolicyChangeMessage, to get policy name for the system message. And getPolicyChangeMessage tries to fetch the policy name by first fetching policy using policyID. Since there is no policy in onyx that is associated with the deleted policyID there won't be no policy name.
What changes do you think we should make in order to solve the problem?
When there is no policy that is associated with the policyID, we can use policy name from the archived report (report.policyName)
We should get a report that is associated with the policy using getAllPolicyReports. Get the first report from the array of reports. Optionally we can create a utility function that returns the first report that is associated with the deleted poliyID
Then we can use report.policyName prop to get the policy name
Optionally we can create a utility function that returns the first report that is associated with the deleted poliyID
On alternative solution, I have added implementation detail about my suggestion to create a utility function that returns the first report associated with with deleted policyID.
Note for C+: I have already mentioned in my proposal that we can create utility function that can get the first report that is associated with the deleted policyID before the first proposal added alternative solution by adding implementation. The first proposal's alternative solution seems to come as mutation of my proposal.
@dylanexpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
changed the title [-][$250] Expense- "changed the workspace to" message becomes incomplete after leaving workspaces[/-][+][Due for payment 2025-08-01] [$250] Expense- "changed the workspace to" message becomes incomplete after leaving workspaces[/+]on Jul 25, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.85-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@DylanDylann@dylanexpensify 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]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[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: None, this is not a bug. It is a case wasn't considered
[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:
Regression Test Proposal
Precondition:
User is invited to three workspaces - A, B and C.
Test:
Go to workspace chat A.
Submit an expense to the workspace chat.
Go to expense report.
Click More > Change workspace.
Select workspace B.
Click More > Change workspace.
Select workspace C.
Leave workspace A and B.
Go back to the expense report.
Check that changed workspace system message linked to the workspaces you left from read "changed the workspace".
Activity
melvin-bot commentedon Jun 13, 2025
Triggered auto assignment to @dylanexpensify (
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.FitseTLT commentedon Jun 13, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-06-13 13:00:55 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense- "changed the workspace to" message becomes incomplete after leaving workspaces
What is the root cause of that problem?
Whenever we couldn't get the name of the policy name here
App/src/libs/ReportUtils.ts
Lines 5870 to 5873 in 2908e67
couldn't be calculated due to workspace data not being available we display empty string after to on the copy here
App/src/languages/en.ts
Lines 5753 to 5754 in 2908e67
What changes do you think we should make in order to solve the problem?
The lack of info is expected in the case of the wokspace deletion from onyx due to leaving workspace or deletion but our copy should treat that properly like we did for changedTransaction here
App/src/languages/en.ts
Line 1015 in 2908e67
the
toshould only be displayed if the policy name exists other wise we should display a generic message of sth likechanged the workspacelike thisBut any general message can be suggested by the copy team. Because there might be several variations of the copy like if the toPolicy name doesnt exist but the fromPolicy name exists we can consider another copy which mentions the previous policy name but jumps the toPolicy name with a general text.
Alternatively as the workspace id is always available we can display
workspace #IDmessage but we need to discuss it with design team.If we can update the BE of course we can incorporate the policy names in the original messages of the actions and we can use them as a back up when we can't calculate it in the FE.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
If needed might add a test for
getPolicyChangeMessageto cover this case of the policy not existing in onyx and the result depends on the method we are going to use to deal with the problem.What alternative solutions did you explore? (Optional)
Though a bit costly, we can find (search) in allReports for an archived report linked to the policy and use the report's
oldPolicyNameprop to get the name but no report can still be found linked to the policy and the above update of the copy is mandatory I think.etCoderDysto commentedon Jun 13, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-06-13 13:13:11 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
"changed the workspace to" message becomes incomplete after leaving workspaces
What is the root cause of that problem?
We call getPolicyChangeMessage, to get policy name for the system message. And getPolicyChangeMessage tries to fetch the policy name by first fetching policy using policyID. Since there is no policy in onyx that is associated with the deleted policyID there won't be no policy name.
App/src/libs/ReportUtils.ts
Lines 5867 to 5874 in 2908e67
What changes do you think we should make in order to solve the problem?
When there is no policy that is associated with the policyID, we can use policy name from the archived report (report.policyName)
We can do something like this below
App/src/libs/PolicyUtils.ts
Lines 236 to 238 in 2908e67
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add test for getPolicyChangeMessage to assert that returns a policy name when passing a policyId of a deleted policy.
What alternative solutions did you explore? (Optional)
we can add a function that gets the first report that is associated with the policyID, and use it instead of getAllPolicyReports
FitseTLT commentedon Jun 13, 2025
Added alt solution
etCoderDysto commentedon Jun 13, 2025
Proposal updated:
On alternative solution, I have added implementation detail about my suggestion to create a utility function that returns the first report associated with with deleted policyID.
Note for C+: I have already mentioned in my proposal that we can create utility function that can get the first report that is associated with the deleted policyID before the first proposal added alternative solution by adding implementation. The first proposal's alternative solution seems to come as mutation of my proposal.
melvin-bot commentedon Jun 17, 2025
@dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jun 19, 2025
@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Jun 23, 2025
@dylanexpensify 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
dylanexpensify commentedon Jun 25, 2025
Reviewing today!
melvin-bot commentedon Jun 27, 2025
@dylanexpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
43 remaining items
[-][$250] Expense- "changed the workspace to" message becomes incomplete after leaving workspaces[/-][+][Due for payment 2025-08-01] [$250] Expense- "changed the workspace to" message becomes incomplete after leaving workspaces[/+]melvin-bot commentedon Jul 25, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 25, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.85-5 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-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 25, 2025
@DylanDylann @dylanexpensify 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]
DylanDylann commentedon Aug 4, 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: None, this is not a bug. It is a case wasn't considered
[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:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
dylanexpensify commentedon Aug 4, 2025
Payment summary:
Contributor: @FitseTLT $250 via Upwork
Contributor+: @DylanDylann $250 via NewDot
Please apply/request!
quinthar commentedon Oct 17, 2025
Approved $250 to @DylanDylann