Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.12k stars 2.61k forks source link

Workspace - Composer in workspace chat is not hidden after deleting the workspace #44848

Open lanitochka17 opened 3 days ago

lanitochka17 commented 3 days ago

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.0.4-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace
  3. Go to workspace chat
  4. Go to Account settings > Workspaces
  5. Delete the workspace
  6. Go back to workspace chat.

Expected Result:

The composer in the workspace chat will be hidden because the chat is archived

Actual Result:

The composer in the workspace chat is not hidden when the chat is archived

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/4c114bd3-8369-4292-95b7-2eadccfc95d1

View all open jobs on GitHub

lanitochka17 commented 3 days ago

We think that this bug might be related to #wave-collect - Release 1

tienifr commented 2 days ago

Proposal

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

The composer in the workspace chat is not hidden when the chat is archived

What is the root cause of that problem?

isArchivedRoom is not correct:

https://github.com/Expensify/App/blob/26ba14ab06af1a3185a0a2468151c1da19992118/src/pages/home/report/ReportFooter.tsx#L104

Because when reportNameValuePairs existed but it did not contain isArchived, we would return undefined here:

https://github.com/Expensify/App/blob/9ac74bd115f79e7fc37a7a1a5b4a0cdd773fbc53/src/libs/ReportUtils.ts#L1256-L1258

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

If reportNameValuePairs did not contain isArchived, we should skip the check based on reportNameValuePairs and use the below report-based check instead:

https://github.com/Expensify/App/blob/9ac74bd115f79e7fc37a7a1a5b4a0cdd773fbc53/src/libs/ReportUtils.ts#L1260

if (reportNameValuePairs && 'isArchived' in reportNameValuePairs) {
    return !!reportNameValuePairs.isArchived;
}

What alternative solution did you explore?

We should fix the BE to return isArchived: true because I only see the BE returned private_isArchived.