Skip to content

[Paid] [$250] Expense - "Change workspace" does not show all workspaces if workspace chat is not opened first #64173

Closed

Description

@nlemma

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.
  1. Go to staging.new.expensify.com
  2. Open workspace chat A, B and C.
  3. Go to workspace chat A.
  4. Submit an expense to the workspace chat.
  5. Click on the expense preview.
  6. Click More > Change workspace.
  7. All the invited workspaces A, B and C are shown in the workspace list.
  8. Close the RHP and send a message in the expense report.
  9. Go to Account > Troubleshoot > Clear cache and restart.
  10. Click Reset and refresh.
  11. Go back to Inbox. Do not open any workspace chat other than workspace chat A.
  12. Click on the expense preview in workspace chat A.
  13. Click More.
  14. Result 1 - Change workspace option is missing in More menu.
  15. Open workspace chat B.
  16. Go back to workspace chat A and open expense report.
  17. Click More > Change workspace.
  18. Result 2 - Workspace A and B are shown in the workspace list.
  19. Open workspace chat C.
  20. Go back to workspace chat A and open expense report.
  21. Click More > Change workspace.
  22. 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

View all open jobs on GitHub

Issue OwnerCurrent 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 OwnerCurrent Issue Owner: @ishpaul777

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 13, 2025
  2. melvin-bot commented on Jun 13, 2025

    @melvin-bot

    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.

  3. Burhan-Rashid commented on Jun 14, 2025

    @Burhan-Rashid
    Contributor

    When we reset and refresh the App, we clear most of the onyx data including the policy data and refetch everything using this api/OpenApp but the policy onyx data that we get in the response of this api/OpenApp has empty employeeList for all the policies which causes this issue. Backend needs to send valid employeeList for all the policies in 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 proper employeeList.

    return isPaidGroupPolicyPolicyUtils(newPolicy) && (isPolicyMember(submitterEmail, newPolicy?.id) || isPolicyAdmin(newPolicy?.id, policies));

    return !!currentUserLogin && !!policyID && !!allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]?.employeeList?.[currentUserLogin];
    condition return false when we we have empty employeeList in the policy.

    To fix this issue we need to send the valid employeeList for all the policies in this api/OpenApp @twisterdotcom

    Image
  4. twisterdotcom commented on Jun 16, 2025

    @twisterdotcom
    Contributor

    @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?

  5. added
    InternalRequires API changes or must be handled by Expensify staff
    Hot PickReady for an engineer to pick up and run with
    on Jun 16, 2025
  6. muttmuure commented on Jun 16, 2025

    @muttmuure
    Contributor

    I think it depends on the number of employees

  7. puneetlath commented on Jun 16, 2025

    @puneetlath
    Contributor

    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.

  8. dmkt9 commented on Jun 17, 2025

    @dmkt9
    Contributor

    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 isWorkspaceEligibleForReportChange because currently if the admin of 2 workspaces of 2 different employees will still show Change workspace, but when executing it will report an error of no permission. We can use the function canRequestMoney to check that only people who are able to submit expenses can change the workspace.

    function canRequestMoney(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>, otherParticipants: number[]): boolean {

  9. twisterdotcom commented on Jun 17, 2025

    @twisterdotcom
    Contributor

    Okay, so can we do this externally then?

  10. Burhan-Rashid commented on Jun 17, 2025

    @Burhan-Rashid
    Contributor

    @luacmartins has recently worked on this change. #62062

    return isPaidGroupPolicyPolicyUtils(newPolicy) && (isPolicyMember(submitterEmail, newPolicy?.id) || isPolicyAdmin(newPolicy?.id, policies));

    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 employeeList of the policy. Can we directly use policy.role instead?

  11. 82 remaining items

  12. changed the title [-][$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[/+] on Oct 3, 2025
  13. melvin-bot commented on Oct 3, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Oct 3, 2025

    @melvin-bot

    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:

  15. melvin-bot commented on Oct 3, 2025

    @melvin-bot

    @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]

  16. Burhan-Rashid commented on Oct 9, 2025

    @Burhan-Rashid
    Contributor

    @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

    Image
  17. twisterdotcom commented on Oct 9, 2025

    @twisterdotcom
    Contributor

    Payment Summary:

  18. changed the title [-][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[/+] on Oct 9, 2025
  19. ishpaul777 commented on Oct 14, 2025

    @ishpaul777
    Contributor

    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:

    • User is invited to three workspaces - A, B and C.

    Test:

    1. Go to staging.new.expensify.com
    2. Open workspace chat A, B and C.
    3. Go to workspace chat A.
    4. Submit an expense to the workspace chat.
    5. Click on the expense preview.
    6. Click More > Change workspace.
    7. All the invited workspaces A, B and C are shown in the workspace list.
    8. Close the RHP and send a message in the expense report.
    9. Go to Account > Troubleshoot > Clear cache and restart.
    10. Click Reset and refresh.
    11. Go back to Inbox. Do not open any workspace chat other than workspace chat A.
    12. Click on the expense preview in workspace chat A.
    13. Click More.
    14. Verify that change workspace option is there.
    15. Verify that all the invited workspaces A,B and C are shown in the workspace list.
    16. Verify that you are able to change to other workspaces when the report owner is and isn't a part of the policy.

    Do we agree 👍 or 👎

  20. changed the title [-][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[/+] on Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions