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

Commit

Permalink
Fix presence bug introduced in 1.64 by #13313 (#14243)
Browse files Browse the repository at this point in the history
* Fix presence bug introduced in 1.64 by #13313

Signed-off-by: Mathieu Velten <[email protected]>

* Add changelog

* Add DISTINCT

* Apply suggestions from code review

Signed-off-by: Mathieu Velten <[email protected]>
  • Loading branch information
Mathieu Velten committed Oct 27, 2022
1 parent cbe01cc commit 4dc05f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/14243.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse 1.64.0 where presence updates could be missing from `/sync` responses.
3 changes: 1 addition & 2 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def do_users_share_a_room_txn(
# user and the set of other users, and then checking if there is any
# overlap.
sql = f"""
SELECT b.state_key
SELECT DISTINCT b.state_key
FROM (
SELECT room_id FROM current_state_events
WHERE type = 'm.room.member' AND membership = 'join' AND state_key = ?
Expand All @@ -751,7 +751,6 @@ def do_users_share_a_room_txn(
SELECT room_id, state_key FROM current_state_events
WHERE type = 'm.room.member' AND membership = 'join' AND {clause}
) AS b using (room_id)
LIMIT 1
"""

txn.execute(sql, (user_id, *args))
Expand Down

0 comments on commit 4dc05f3

Please sign in to comment.