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

[$500] Web - Remove member from workspace does not hide workspace's rooms on that member account when he's offline #23000

Closed
1 of 6 tasks
kbecciv opened this issue Jul 17, 2023 · 35 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Internal Requires API changes or must be handled by Expensify staff Needs Reproduction Reproducible steps needed

Comments

@kbecciv
Copy link

kbecciv commented Jul 17, 2023

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


Action Performed:

  1. Login with account A and B on two browsers/devices
  2. Create a workspace with A and B (A is admin)
  3. Create a room for that workspace
  4. Verify that on B, the workspace rooms & channels appear
  5. On B, close App
  6. On A, remove B from the workspace
  7. On B, re-open App
  8. Verify that the workspace's rooms & channels does not disappear
    Workaround
    The rooms/channels only disappears when B clicks on each of them

Expected Result:

The workspace's rooms/channels disappear immediately on App opening when he's previously removed from that workspace.

Actual Result:

The workspace's rooms/channels does not disappear on App opening when he's previously removed from that workspace. Instead it requires manual navigation to each room/channel to be removed.

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.41-2
Reproducible in staging?: n/a
Reproducible in production?: n/a
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-07-14.at.12.27.47.1.mov

Expensify/Expensify Issue URL:
Issue reported by: @tienifr
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689313795202979

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c726371d1e861cb4
  • Upwork Job ID: 1704756557394501632
  • Last Price Increase: 2023-10-12
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@kbecciv
Copy link
Author

kbecciv commented Jul 17, 2023

Proposal

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

User can still see the workspace chat even when he's removed from the workspace while he's offline.

What is the root cause of that problem?

This problem doesn't happen before, that's because earlier the OpenApp API is called whenever we load the page again. This will populate all the policies and reports data, and will not show stale data.
However, after this PR, we no longer call OpenApp on page load for performance reason (because OpenApp fetches all the data so it's slow), we only call ReconnectApp if the user was already logged in before.
After the user is removed from the workspace and the user loads the page, the ReconnectApp only sends back "set workspace to null", not "set reports and reportActions related to this workspace to null" (as the Pusher will send if the user opens the app at the time).
So that's the root cause. This not only happens when the the user is removed from the workspace and the user loads the page, it also happens when the user is re-added to the workspace and loads the page, the default chat reports will not show (because it's not sent back in ReconnectApp)

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

  1. We need to fix the back-end to return correct report and reportActions data in ReconnectApp for the following case:
  • The user is removed from the workspace and the user loads the page: should set report and reportActions of the workspace-related reports to null.
  • The user is re-added to the workspace and loads the page: should send workspace-related reports and reportActions data.
  1. For existing users which have incorrect data in Onyx due to this, and to be future-proof, we can add logic in
    function canAccessReport(report, policies, betas) {
    to return false if the report is associated to a workspace and that workspace is no longer available. This will work for both default rooms and user-created rooms.

What alternative solutions did you explore? (Optional)

In 2, another solution is in the Onyx.connect for policy data, if we see the policy is set to null, we'll remove the associated report data from Onyx.

@sakluger
Copy link
Contributor

I couldn't reproduce this on the latest build, closing for now.

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2023
@tienifr
Copy link
Contributor

tienifr commented Jul 20, 2023

@sakluger I still can reproduce it. Notice that the workspace has rooms rather than #announce room. And the room should disappear immediately on re-opening App, not postpone until we click on it. I observe that the #announce room has already been fixed.

member-workspace-compressed.mov

@tienifr
Copy link
Contributor

tienifr commented Jul 27, 2023

Bump @sakluger.

@tienifr
Copy link
Contributor

tienifr commented Sep 7, 2023

The issue still persists today. Bumped on Slack.

@sakluger sakluger removed the Needs Reproduction Reproducible steps needed label Sep 21, 2023
@sakluger
Copy link
Contributor

Reopening after watching @tienifr's more recent video recording.

room-disappear-compressed.mov

@sakluger sakluger reopened this Sep 21, 2023
@sakluger sakluger added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 21, 2023
@melvin-bot melvin-bot bot changed the title Web - Remove member from workspace does not hide workspace's rooms on that member account when he's offline [$500] Web - Remove member from workspace does not hide workspace's rooms on that member account when he's offline Sep 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01c726371d1e861cb4

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@burczu
Copy link
Contributor

burczu commented Sep 25, 2023

For now I can't reproduce this issue due to the problem with workspace invitations described here: https://expensify.slack.com/archives/C049HHMV9SM/p1695627542846449 - I need to wait until it's resolved.

There is also an issue created already: #28130

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@burczu
Copy link
Contributor

burczu commented Sep 27, 2023

I've finally reviewed the proposal from @kbecciv @tienifr and I think it does make sense. In the proposal we need to update BE first so I think we should go Internal for now to get an opinion from the BE engineer.

cc: @sakluger

@tienifr
Copy link
Contributor

tienifr commented Sep 27, 2023

Actually that was mine. @kbecciv might have missed that.

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

Triggered auto assignment to @marcochavezf (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

Current assignee @burczu is eligible for the Internal assigner, not assigning anyone new.

@sakluger sakluger added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@sakluger
Copy link
Contributor

sakluger commented Oct 2, 2023

I've added the internal label on @burczu's recommendation. @marcochavezf are you able to work on the backend piece of this so that we can move forward with the external piece?

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@marcochavezf
Copy link
Contributor

marcochavezf commented Oct 3, 2023

Sure, I will be checking the backend implementation during the week. Seems it could be an edge case where we're not including the null reports in the ReconnectApp as stated in the proposal

@tienifr
Copy link
Contributor

tienifr commented Oct 4, 2023

I've added the internal label on @burczu's recommendation. @marcochavezf are you able to work on the backend piece of this so that we can move forward with the external piece?

@sakluger If we're good with my suggested solution, could you assign me to the issue so I can work on the front-end part after the back-end change is done, thanks!

@sakluger
Copy link
Contributor

sakluger commented Oct 5, 2023

@marcochavezf I'm not sure if you were just saying that you were happy to work on the backend piece, or if you were also endorsing a solution. Can you confirm if @tienifr's solution works?

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@marcochavezf
Copy link
Contributor

Ah I mean that I can work on the backend piece. In this case I think the backend implementation should be done first.

@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

@sakluger, @marcochavezf, @burczu Whoops! This issue is 2 days overdue. Let's get this updated quick!

@marcochavezf
Copy link
Contributor

No update, but I am prioritizing this one for this week

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2023
@tienifr
Copy link
Contributor

tienifr commented Oct 9, 2023

@marcochavezf If we're good with my suggested solution, could you assign me to the issue so I can work on the front-end part after the back-end change is done, thanks!

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@melvin-bot melvin-bot bot added the Overdue label Oct 12, 2023
@sakluger
Copy link
Contributor

Interesting, sounds like this may have somehow gotten fixed. @marcochavezf any idea why it's not reproduceable anymore?

@melvin-bot melvin-bot bot removed the Overdue label Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@marcochavezf
Copy link
Contributor

There have been many policy changes recently from other wave initiatives that probably fixed this by side effect, I think it's a good thing that's not reproducible anymore.

@melvin-bot melvin-bot bot added the Overdue label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@sakluger, @marcochavezf, @burczu Whoops! This issue is 2 days overdue. Let's get this updated quick!

@marcochavezf
Copy link
Contributor

Not reproducible anymore

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@marcochavezf marcochavezf added the Needs Reproduction Reproducible steps needed label Oct 16, 2023
@sakluger
Copy link
Contributor

Okay then, closing!

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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Internal Requires API changes or must be handled by Expensify staff Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

6 participants