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] Room - Removed room member reappears as a member of the room when navigate from Search #35289

Closed
3 of 6 tasks
lanitochka17 opened this issue Jan 28, 2024 · 11 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 28, 2024

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: 1.4.32-2
Reproducible in staging?: Y
Reproducible in production?: Y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Login as User A
  2. Navigate to Settings> Workspace> New workspace> Invite User B
  3. User A creates Public room and invite User B
  4. User A removes User B from room
  5. As User B via search open the room

Expected Result:

User B should not be the member of the room since he is removed

Actual Result:

Removed room member User B reappears as a member of the room when navigate from Search

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6347827_1705682418618.Recording__1859.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01af101db271cd09e0
  • Upwork Job ID: 1751622290419175424
  • Last Price Increase: 2024-02-04
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 28, 2024
@melvin-bot melvin-bot bot changed the title Room - Removed room member reappears as a member of the room when navigate from Search [$500] Room - Removed room member reappears as a member of the room when navigate from Search Jan 28, 2024
Copy link

melvin-bot bot commented Jan 28, 2024

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

Copy link

melvin-bot bot commented Jan 28, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 28, 2024
Copy link

melvin-bot bot commented Jan 28, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave8.
CC @zanyrenney

@JordanLevy19
Copy link

Unable to replicate on the specified supported platforms - however the search was still a bit buggy while testing so suspect there may be some clues there -

Please re-state the problem that we are trying to solve in this issue.
There's a bug where a user who has been removed from a chat room can still access, and interact with that room through the search function.

Root Cause of the Problem:
The root cause of the issue, where a recently removed user still sees a chat room in search results, may lie in the delayed or inconsistent updating of the BaseOptionsSelector component's state.

Suggested Changes to Solve the Problem:

Ensure Real-Time Data Updates:
Modify the componentDidUpdate method to more effectively handle updates related to room membership changes. This ensures that any changes in the user's status are immediately reflected in the search results.

componentDidUpdate(prevProps) {
if (!_.isEqual(this.props.sections, prevProps.sections)) {
const newSections = this.sliceSections();
this.setState({ sections: newSections });
}
...
}

Refine Search Result Filtering:
Adjust the logic in methods like sliceSections or flattenSections to filter out rooms that the user should no longer have access to. This may involve adding checks to confirm the user's current membership status before including a room in the list.

sliceSections() {
return .map(this.props.sections, (section) => {
if (
.isEmpty(section.data) || !userHasAccess(section)) {
return section;
}
...
});
}

Optimize State Management in Search:
In the updateSearchValue method, ensure that the search results are not just based on the input value but also consider the user's current room memberships.

updateSearchValue(value) {
this.setState({
paginationPage: 1,
value,
});
this.props.onChangeText(value);
this.refreshSearchResults(); // Implement this method to refresh the list based on current membership status
}

@melvin-bot melvin-bot bot added the Overdue label Jan 30, 2024
@abdulrahuman5196
Copy link
Contributor

Will work on review today.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 31, 2024
@abdulrahuman5196
Copy link
Contributor

@lanitochka17 In the video, at last user B has messaged hi and joined the chat, since its a public room it adds them as the member right? Isn't this expected.
@abekkala

@melvin-bot melvin-bot bot removed the Overdue label Feb 2, 2024
Copy link

melvin-bot bot commented Feb 4, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

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

@abekkala
Copy link
Contributor

abekkala commented Feb 6, 2024

messaged hi and joined the chat, since its a public room it adds them as the member right? Isn't this expected.

yes, this is expected. if you access a room and take an action such as leaving a comment, you are added as a member.

@melvin-bot melvin-bot bot removed the Overdue label Feb 6, 2024
@abdulrahuman5196
Copy link
Contributor

@abekkala Then could we close this issue as expected?

@abekkala abekkala closed this as completed Feb 9, 2024
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 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
Projects
None yet
Development

No branches or pull requests

4 participants