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

Commit 4dc05f3

Browse files
author
Mathieu Velten
authored
Fix presence bug introduced in 1.64 by #13313 (#14243)
* 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]>
1 parent cbe01cc commit 4dc05f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

changelog.d/14243.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in Synapse 1.64.0 where presence updates could be missing from `/sync` responses.

synapse/storage/databases/main/roommember.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def do_users_share_a_room_txn(
742742
# user and the set of other users, and then checking if there is any
743743
# overlap.
744744
sql = f"""
745-
SELECT b.state_key
745+
SELECT DISTINCT b.state_key
746746
FROM (
747747
SELECT room_id FROM current_state_events
748748
WHERE type = 'm.room.member' AND membership = 'join' AND state_key = ?
@@ -751,7 +751,6 @@ def do_users_share_a_room_txn(
751751
SELECT room_id, state_key FROM current_state_events
752752
WHERE type = 'm.room.member' AND membership = 'join' AND {clause}
753753
) AS b using (room_id)
754-
LIMIT 1
755754
"""
756755

757756
txn.execute(sql, (user_id, *args))

0 commit comments

Comments
 (0)