Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports - Report name is "Unavailable workspace" after workspace is deleted #56580

Open
8 tasks done
IuliiaHerets opened this issue Feb 8, 2025 · 15 comments
Open
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.95-1
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
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): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace.
  3. Go to workspace chat.
  4. Send a message in the workspace chat.
  5. Delete the workspace.
  6. Go to Reports > Chats.

Expected Result:

The report name for the deleted workspace should be the name of the workspace.

Actual Result:

The report name for the deleted workspace is "Unavailable workspace".

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6737081_1739022656494.20250208_214633.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment labels Feb 8, 2025
Copy link

melvin-bot bot commented Feb 8, 2025

Triggered auto assignment to @johncschuster (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.

Copy link

melvin-bot bot commented Feb 8, 2025

Triggered auto assignment to @AndrewGable (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Feb 8, 2025
Copy link

melvin-bot bot commented Feb 8, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 8, 2025
Copy link
Contributor

github-actions bot commented Feb 8, 2025

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@samranahm
Copy link

samranahm commented Feb 8, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-08 21:20:53 UTC.

Proposal

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

Report name is "Unavailable workspace" after workspace is deleted

What is the root cause of that problem?

Here

const finalPolicy = policy ?? policies?.find((p) => p.id === report.policyID) ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];

We try to get the policy from Params

policy ?? policies?.find((p) => p.id === report.policyID)

that indeed return the policy when available but as soon the policy get deleted our first value policy become empty object and because its truthy value so it does not fallback to next value.

Due to this noPolicyFound get assigned in policyName that display Unavailable workspace

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

we should explicitly check if policy object is empty, so that we can fetch the finalPolicy from right source

const finalPolicy = isEmptyObject(policy) ? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] : policy ?? policies?.find((p) => p.id === report.policyID);

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)

We can return undefined for policy when it deleted instead of empty object

Results

Screen.Recording.2025-02-09.at.2.08.38.AM.mov

@AndrewGable
Copy link
Contributor

@samranahm - Any ideas which recent changes introduced this?

@AndrewGable
Copy link
Contributor

Seems like it was introduced in #50135

@luacmartins @zfurtak is this expected behavior?

@luacmartins
Copy link
Contributor

Commented in Slack, but I don't think we need to block the deploy on this. Let's remove the label and let @zfurtak work on a follow up fix.

@AndrewGable AndrewGable added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Feb 10, 2025
@AndrewGable
Copy link
Contributor

@zfurtak comment here and @luacmartins can assign you, thank you!

@samranahm
Copy link

@luacmartins Proposal here please take a look, thank you

@zfurtak
Copy link
Contributor

zfurtak commented Feb 10, 2025

Here I am 😊

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 10, 2025
@DylanDylann
Copy link
Contributor

DylanDylann commented Feb 11, 2025

@zfurtak @luacmartins Let's see the below image

Image

Some cases still display "unavailable workspace", the reason for these cases is due to the policy field is lost in Onyx (I can't find it in Onyx anymore). We can reproduce this bug when log out (reset cache) and login again

@samranahm
Copy link

@luacmartins I proposed this solution first, would you please take a look

@luacmartins
Copy link
Contributor

@samranahm thanks for the interest, but @zfurtak is handling this one as the original author

@samranahm
Copy link

Got it, thanks for clarifying @luacmartins

@zfurtak @luacmartins Let's see the below image

Image Some cases still display "unavailable workspace", the reason for these cases is due to the `policy` field is lost in Onyx (I can't find it in Onyx anymore). We can reproduce this bug when log out (reset cache) and login again

Well, I am trying to find the best possible solution for this edge case and will update here as soon I find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants