-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove outlier check for retrieving membership events #15889
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Remove outlier check for getting membership events through the `/_matrix/client/r0/rooms/{roomId}/event/{eventId}` endpoint. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR probably needs more eyes on whether we want to do this so I've put it back in the review queue |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm failing to see how this fixes the bug -- is this saying that a user should always be allowed to see their own membership event where previously we would only check this if it was an outlier? I'm guessing it might not be an outlier if there are other users in the room, but the user in question hasn't joined yet? I'm really not sure this matches what the spec says:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,14 +207,18 @@ async def filter_event_for_clients_with_state( | |
): | ||
allowed_user_ids.discard(user_id) | ||
|
||
# Normally these can't be seen by clients, but we make an exception for | ||
# for membership events (eg, incoming invites, or rejections of | ||
# said invite) for the user themselves. | ||
if event.type == EventTypes.Member and event.state_key in allowed_user_ids: | ||
logger.debug("Returning membership event %s", event) | ||
return {event.state_key} | ||
jmartinesp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# We don't want to show outlier events to the client because | ||
# we haven't figured out where they fit into the DAG yet. The | ||
# only exception is out-of-band membership events which is | ||
# handled above. | ||
if event.internal_metadata.outlier: | ||
# Normally these can't be seen by clients, but we make an exception for | ||
# for out-of-band membership events (eg, incoming invites, or rejections of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reference, out-of-band membership events has some docs written here: We might want to better clarify it once we figure out what we want/can do. If we need a new label for the "membership events for the user themselves" we should also figure that out |
||
# said invite) for the user themselves. | ||
if event.type == EventTypes.Member and event.state_key in allowed_user_ids: | ||
logger.debug("Returning out-of-band-membership event %s", event) | ||
return {event.state_key} | ||
|
||
return set() | ||
|
||
# First we get just the history visibility in case its shared/world-readable | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably create a spec issue to track clarifying the out-of-band membership behavior, https://github.com/matrix-org/matrix-spec/issues