Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Stop get_joined_users corruption from custom statuses
Browse files Browse the repository at this point in the history
Fix a bug where the `get_joined_users` cache could be corrupted by custom
status events (or other state events with a state_key matching the user ID).

Fixes: #7099.
  • Loading branch information
richvdh committed Apr 30, 2020
1 parent 204664d commit e723ce3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7376.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug which could cause messages not to be sent over federation, when state events with state keys matching user IDs (such as custom user statuses) were received statuses.
3 changes: 2 additions & 1 deletion synapse/storage/data_stores/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ def _get_joined_users_from_context(
if key[0] == EventTypes.Member
]
for etype, state_key in context.delta_ids:
users_in_room.pop(state_key, None)
if etype == EventTypes.Member:
users_in_room.pop(state_key, None)

# We check if we have any of the member event ids in the event cache
# before we ask the DB
Expand Down

0 comments on commit e723ce3

Please sign in to comment.