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

Invalidate members on kick to prevent stale results #4382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/matrix-sdk/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,10 @@ impl Room {
{ reason: reason.map(ToOwned::to_owned) }
);
self.client.send(request, None).await?;

// Force future room members reload
self.mark_members_missing();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks sensible to me, but I'd like to double-check with @poljar .

In the meantime, I would have thought that if we need this in kick_user, we would also need it in ban_user and unban_user too. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, its is almost certainly needed in ban_user also, I will update it there.

For unban_user they are probably not currently in the member list right, after an unban_user you would need to invite them (which would trigger an invalidate)? Unless I'm misunderstanding and the members list contains a list of unbaned users?


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have a test that checks this behaviour too.

Ok(())
}

Expand Down
Loading