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.52k stars 2.87k forks source link

[$250] Chat - Unavailable workspace is displayed on chat header when go to chat while logged out #47736

Closed lanitochka17 closed 1 month ago

lanitochka17 commented 2 months 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.22-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: https://expensify.testrail.io/index.php?/tests/view/4874559&group_by=cases:section_id&group_id=229066&group_order=asc Email or phone of affected tester (no customers): gocemate+a1028@gmail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Copy the link of a conversation
  2. Log out of the app
  3. Navigate to the conversation URL
  4. Log in
  5. Verify you're redirected to the correct conversation after login
  6. Take a look at chat header

Expected Result:

Unavailable workspace should not be displayed on chat header

Actual Result:

Unavailable workspace is displayed on chat header when go to chat while logged out

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/d5e767cf-6367-4522-b54f-781097eaa531

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01050a994b56365205
  • Upwork Job ID: 1828594928061815307
  • Last Price Increase: 2024-09-04
Issue OwnerCurrent Issue Owner: @shubham1206agra
melvin-bot[bot] commented 2 months ago

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

lanitochka17 commented 2 months ago

@stephanieelliott FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 commented 2 months ago

We think that this bug might be related to #vip-vsp

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

@stephanieelliott Still overdue 6 days?! Let's take care of this!

stephanieelliott commented 2 months ago

I see a lot of bug bug reports but they are either related to focus mode or slow API response. This seems like neither so adding the labels for this to be worked on.

wave-collect since it's related to workspace chats

melvin-bot[bot] commented 2 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01050a994b56365205

melvin-bot[bot] commented 2 months ago

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

nkdengineer commented 2 months ago

Proposal

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

Unavailable workspace is displayed on chat header when go to chat while logged out

What is the root cause of that problem?

Sometimes when the user only has a personal policy, the policy data may be available after the report data. Let's see the image below that I logged the report data, and allPolicies data via useOnyx in HeaderView

Screenshot 2024-08-28 at 14 47 46

Then the policyName is Unavailable workspace briefly https://github.com/Expensify/App/blob/071f11ce1012db7d07eb750d74f58b552eba6144/src/pages/home/HeaderView.tsx#L85

https://github.com/Expensify/App/blob/071f11ce1012db7d07eb750d74f58b552eba6144/src/libs/ReportUtils.ts#L746-L748

That leads renderAdditionalText being displayed

https://github.com/Expensify/App/blob/071f11ce1012db7d07eb750d74f58b552eba6144/src/pages/home/HeaderView.tsx#L114

After the policy data is available, an empty string is returned here and it disappears

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

For this case, let us return noPolicyFound because if returnEmptyIfNotFound is true we always want to display the empty string for the not found policy.

https://github.com/Expensify/App/blob/071f11ce1012db7d07eb750d74f58b552eba6144/src/libs/ReportUtils.ts#L746-L749

Or for the DM the policyID is _FAKE_, we can return early noPolicyFound or empty if policyID is fake

What alternative solutions did you explore? (Optional)

stephanieelliott commented 2 months ago

Hey @shubham1206agra can you review this proposal?

CyberAndrii commented 2 months ago

I think this is a duplicate of https://github.com/Expensify/App/issues/44480

shubham1206agra commented 2 months ago

Lets go with @nkdengineer's proposal.

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

shubham1206agra commented 2 months ago

I think this is a duplicate of #44480

Thanks for the heads up, but I feel @nkdengineer solution is better.

Especially this

Or for the DM the policyID is FAKE, we can return early noPolicyFound or empty if policyID is fake

melvin-bot[bot] commented 2 months ago

@stephanieelliott @marcaaron @shubham1206agra this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

marcaaron commented 2 months ago

Thanks for the heads up, but I feel @nkdengineer solution is better.

They linked to an issue. Is it a duplicate or not?

shubham1206agra commented 2 months ago

Thanks for the heads up, but I feel @nkdengineer solution is better.

They linked to an issue. Is it a duplicate or not?

RCA of both bug is the same, but they seem to approach this issue differently. I personally think the solution is wrong there.

marcaaron commented 2 months ago

Can you please share your opinion with everyone involved in that other issue and see what they say? It's not great to let a separate ticket fix the same bug in a different way. Let's communicate our intentions first.

melvin-bot[bot] commented 2 months ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

shubham1206agra commented 1 month ago

@marcaaron Please close this. Since other ticket has an open PR now.