App icon indicating copy to clipboard operation
App copied to clipboard

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

Open lanitochka17 opened this issue 1 year ago β€’ 20 comments

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.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): [email protected] 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?

  • [ ] Android: Native
  • [x] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

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

lanitochka17 avatar Aug 20 '24 17:08 lanitochka17

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.

melvin-bot[bot] avatar Aug 20 '24 17:08 melvin-bot[bot]

@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 avatar Aug 20 '24 17:08 lanitochka17

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

lanitochka17 avatar Aug 20 '24 17:08 lanitochka17

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

melvin-bot[bot] avatar Aug 23 '24 18:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 27 '24 18:08 melvin-bot[bot]

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

stephanieelliott avatar Aug 28 '24 00:08 stephanieelliott

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

melvin-bot[bot] avatar Aug 28 '24 00:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 28 '24 00:08 melvin-bot[bot]

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)

nkdengineer avatar Aug 28 '24 07:08 nkdengineer

Hey @shubham1206agra can you review this proposal?

stephanieelliott avatar Aug 30 '24 01:08 stephanieelliott

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

andriivitiv avatar Aug 30 '24 07:08 andriivitiv

Lets go with @nkdengineer's proposal.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

shubham1206agra avatar Sep 02 '24 06:09 shubham1206agra

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

melvin-bot[bot] avatar Sep 02 '24 06:09 melvin-bot[bot]

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

shubham1206agra avatar Sep 02 '24 06:09 shubham1206agra

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

melvin-bot[bot] avatar Sep 03 '24 18:09 melvin-bot[bot]

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

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

marcaaron avatar Sep 04 '24 00:09 marcaaron

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.

shubham1206agra avatar Sep 04 '24 01:09 shubham1206agra

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.

marcaaron avatar Sep 04 '24 02:09 marcaaron

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Sep 04 '24 16:09 melvin-bot[bot]

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

shubham1206agra avatar Sep 07 '24 15:09 shubham1206agra