Skip to content

[$250] [Due for payment 2025-11-17] Report - Error message when trying to change report Workspace after clearing cache. #69320

Closed

Description

@jponikarchuk

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.99-5
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://test-management.browserstack.com/projects/2219752/test-runs/TR-442/folder/13176670/41237098/861421037
Email or phone of affected tester (no customers): ibellicotest+1677@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least two workspaces available.

  1. Open the staging.new.expensify.com website.
  2. Open any workspace chat.
  3. Submit a manual expense to it.
  4. Navigate to "Account" > "Troubleshoot"
  5. Tap on "Clear cache and restart"
  6. Click on "Reset and refresh"
  7. Return to workspace chat and open the report of the previously created expense.
  8. Tap on "More" > "Change Workspace"
  9. Select any workspace to move the expense to.
  10. Note that an "Oops, something went wrong and your request could not be completed" error message appears at the bottom of teport.
  11. Navigate to "Workspaces" and open the workspace where the expense was created.
  12. Note that a RBR is displayed on "Members"
  13. Tap on "Members"
  14. Note that an "There was a problem adding this member" error message is displayed below the owner´s Email.
  15. Clear the error and return to "Inbox"
  16. Note that fallback avatar is displayed on "Account" on navigation bar.
  17. Note that both workspaces are displayed as "Chat Report" with fallback avatar.
  18. Open any workspace and return to "Inbox"
  19. Note that now, both workspaces are correctly displayed.

Expected Result:

User should be able to move a report to a different workspace after clearing cache and data without any error during the process.

Actual Result:

When user tries to move a report to another workspace after clearing cache on the app, an "Oops, something went wrong and your request could not be completed" error message appears on report.
Also, when navigating to workspace after this action, a RBR appears on "Members" section and an "There was a problem adding this member" error message appears below the owners Email on members list.
After returning from workspaces section, the "Account" section displays fallback avatar on navigation bar, and both workspaces are displayed as "Chat Report" on "Inbox".

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

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021990741952170914223
  • Upwork Job ID: 1990741952170914223
  • Last Price Increase: 2025-11-18

Activity

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

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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. changed the title [-]Report - Error message when trying to move report to another WS after clearing cache.[/-] [+] Report - Error message when trying to change report Workspace after clearing cache.[/+] on Aug 27, 2025
  4. thelullabyy commented on Aug 27, 2025

    @thelullabyy
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Reports return an error message when attempting to change their workspace after the app cache has been cleared.

    What is the root cause of that problem?

    The issue stems from the logic used to determine whether the user is a member of the target policy. In the ReportChangeWorkspacePage, we use the isPolicyMember function, which relies on the employeeList. However, in certain cases—particularly after the cache has been cleared—the employeeList isn't fetched in time, causing isPolicyMember to return false. This leads the app to treat the user as if they are not a member of the policy, resulting in an invalid API call that triggers the error mentioned in the original post.

    What changes do you think we should make in order to solve the problem?

    We should adjust the logic to skip this check if the current user matches the report.ownerAccountID and is either an admin or owner of the target policy. This way, we can bypass the unreliable employeeList state when we have sufficient information about the user’s role.

    The shouldSkip condition can be defined as either:

    
    currentUserID === report.ownerAccountID && (isPolicyAdmin(policy) || isPolicyOwner(policy, currentUserID));
    

    or more simply:

    
    currentUserID === report.ownerAccountID
    

    The stricter version adds an extra layer of validation based on user role, while the simpler one prioritizes user ownership regardless of role.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

    Option 1: Update the isPolicyMember function itself to include a fallback that checks whether the current user is an admin or owner of the policy. This would broaden the definition of membership to reduce reliance on employeeList.

    Option 2: Besides the membership check, we can use getPolicyExpenseChat to determine whether a policy expense chat already exists between the report.ownerAccountID and the target policy. If it exists, the user can be assumed to be a valid member of that policy:

                } else if (
                    isExpenseReport(report) &&
                    isPolicyAdmin(policy) &&
                    report.ownerAccountID &&
                    !isPolicyMember(policy, getLoginByAccountID(report.ownerAccountID)) &&
                    !getPolicyExpenseChat(report.ownerAccountID, policy.id)
                ) {
    

    Note: All the suggestion code changes only target on our current bug. We can also apply the fix to other places, such as here.

  5. melvin-bot commented on Sep 1, 2025

    @melvin-bot

    @greg-schroeder Huh... This is 4 days overdue. Who can take care of this?

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 2, 2025
  7. melvin-bot commented on Sep 2, 2025

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 2, 2025
  9. melvin-bot commented on Sep 2, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (External)

  10. melvin-bot commented on Sep 5, 2025

    @melvin-bot

    @rojiphil Whoops! This issue is 2 days overdue. Let's get this updated quick!

  11. 63 remaining items

  12. rojiphil commented on Nov 17, 2025

    @rojiphil
    Contributor

    @greg-schroeder BZ Checklist done. Thanks.

  13. greg-schroeder commented on Nov 18, 2025

    @greg-schroeder
    Contributor

    Handling

  14. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Awaiting PaymentAuto-added when associated PR is deployed to production
    on Nov 18, 2025
  15. changed the title [-][Due for payment 2025-11-17] Report - Error message when trying to change report Workspace after clearing cache.[/-] [+][$250] [Due for payment 2025-11-17] Report - Error message when trying to change report Workspace after clearing cache.[/+] on Nov 18, 2025
  16. melvin-bot commented on Nov 18, 2025

    @melvin-bot
  17. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 18, 2025
  18. melvin-bot commented on Nov 18, 2025

    @melvin-bot

    Current assignee @rojiphil is eligible for the External assigner, not assigning anyone new.

  19. greg-schroeder commented on Nov 18, 2025

    @greg-schroeder
    Contributor

    Payment summary:

    Author: @thelullabyy - $250 - Upwork
    Reviewer: @rojiphil - $250 - ND

    Approved for payments as outlined above ☝️

  20. garrettmknight commented on Dec 7, 2025

    @garrettmknight
    Contributor

    $250 approved for @rojiphil

  21. thelullabyy commented on Jan 30, 2026

    @thelullabyy
    Contributor

    Kindly bump for payout on upwork

  22. garrettmknight commented on Feb 3, 2026

    @garrettmknight
    Contributor

    Upwork job paid out and closed.

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions