[Paid] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first #64173
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
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): sdhdsnjoidjsojo34@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
- Open workspace chat A, B and C.
- Go to workspace chat A.
- Submit an expense to the workspace chat.
- Click on the expense preview.
- Click More > Change workspace.
- All the invited workspaces A, B and C are shown in the workspace list.
- Close the RHP and send a message in the expense report.
- Go to Account > Troubleshoot > Clear cache and restart.
- Click Reset and refresh.
- Go back to Inbox. Do not open any workspace chat other than workspace chat A.
- Click on the expense preview in workspace chat A.
- Click More.
- Result 1 - Change workspace option is missing in More menu.
- Open workspace chat B.
- Go back to workspace chat A and open expense report.
- Click More > Change workspace.
- Result 2 - Workspace A and B are shown in the workspace list.
- Open workspace chat C.
- Go back to workspace chat A and open expense report.
- Click More > Change workspace.
- Result 3 - All the workspaces A, B and C are shown in the workspace list.
Expected Result:
After resetting app, Change workspace option should display all the invited workspaces, even if the workspace chats are not opened first.
Actual Result:
In Step 14, 18 and 22, after resetting app, Change workspace option does not display the invited workspaces if the workspace chats are not opened first.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Bug6859042_1749818440003.20250613_202733.mp4
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021945984828448466641
- Upwork Job ID: 1945984828448466641
- Last Price Increase: 2025-07-17
Issue Owner
Current Issue Owner: @ishpaul777Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Jun 13, 2025
Triggered auto assignment to @twisterdotcom (
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.Burhan-Rashid commentedon Jun 14, 2025
When we reset and refresh the App, we clear most of the onyx data including the
policy dataand refetch everything using thisapi/OpenAppbut the policy onyx data that we get in the response of thisapi/OpenApphas emptyemployeeListfor all thepolicieswhich causes this issue. Backend needs to send validemployeeListfor all thepoliciesin this api to fix the issue. When the user clicks on a particular report, only then the policy data of that particular report is fetched again and we get properemployeeList.App/src/libs/ReportUtils.ts
Line 10550 in 8815437
App/src/libs/PolicyUtils.ts
Line 258 in 8815437
To fix this issue we need to send the valid employeeList for all the policies in this api/OpenApp @twisterdotcom
twisterdotcom commentedon Jun 16, 2025
@Burhan-Rashid, the fix for this should be internal then I guess?
@puneetlath / @muttmuure it feels like sending a full employeeList for all policies on OpenApp could slow it down quite a lot right?
muttmuure commentedon Jun 16, 2025
I think it depends on the number of employees
puneetlath commentedon Jun 16, 2025
Hmm, why do we need the employee list? Is the workspace listed on the Workspaces tab? If so, the client is aware that I'm a member of it.
dmkt9 commentedon Jun 17, 2025
I think if we consider the clients who can access the workspace as members, this issue can be solved.
In addition, I think we should add a check condition for the function
isWorkspaceEligibleForReportChangebecause currently if the admin of 2 workspaces of 2 different employees will still showChange workspace, but when executing it will report an error of no permission. We can use the functioncanRequestMoneyto check that only people who are able to submit expenses can change the workspace.App/src/libs/ReportUtils.ts
Line 8263 in 8815437
twisterdotcom commentedon Jun 17, 2025
Okay, so can we do this externally then?
Burhan-Rashid commentedon Jun 17, 2025
@luacmartins has recently worked on this change. #62062
App/src/libs/ReportUtils.ts
Line 10606 in 2371d9f
Can we remove the isPolicyMember(submitterEmail, newPolicy?.id) above. Is there any other way to check if the current user is member of policy other than going through the
employeeListof the policy. Can we directly usepolicy.roleinstead?82 remaining items
[-][$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/-][+][Due for payment 2025-10-10] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/+]melvin-bot commentedon Oct 3, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 3, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.22-6 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-10-10. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 3, 2025
@ishpaul777 @twisterdotcom 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]
Burhan-Rashid commentedon Oct 9, 2025
@twisterdotcom The upwork job for this issue has expired as the issue was opened long time back. Could you please create a new upwork contract for this issue. Thanks
twisterdotcom commentedon Oct 9, 2025
Payment Summary:
[-][Due for payment 2025-10-10] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/-][+][Awaiting checklist completion] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/+]ishpaul777 commentedon Oct 14, 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: i could not pin point it to single E/App PR that introduced the bug it was edge case always existed
[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: no need
[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. yes
[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/557455
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
[-][Awaiting checklist completion] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/-][+][Paid] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first[/+]