* Fix presence bug introduced in 1.64 by #13313 Signed-off-by: Mathieu Velten <mathieuv@matrix.org> * Add changelog * Add DISTINCT * Apply suggestions from code review Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
This commit is contained in:
parent
cbe01ccc3f
commit
4dc05f3019
|
@ -0,0 +1 @@
|
||||||
|
Fix a bug introduced in Synapse 1.64.0 where presence updates could be missing from `/sync` responses.
|
|
@ -742,7 +742,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
||||||
# user and the set of other users, and then checking if there is any
|
# user and the set of other users, and then checking if there is any
|
||||||
# overlap.
|
# overlap.
|
||||||
sql = f"""
|
sql = f"""
|
||||||
SELECT b.state_key
|
SELECT DISTINCT b.state_key
|
||||||
FROM (
|
FROM (
|
||||||
SELECT room_id FROM current_state_events
|
SELECT room_id FROM current_state_events
|
||||||
WHERE type = 'm.room.member' AND membership = 'join' AND state_key = ?
|
WHERE type = 'm.room.member' AND membership = 'join' AND state_key = ?
|
||||||
|
@ -751,7 +751,6 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
||||||
SELECT room_id, state_key FROM current_state_events
|
SELECT room_id, state_key FROM current_state_events
|
||||||
WHERE type = 'm.room.member' AND membership = 'join' AND {clause}
|
WHERE type = 'm.room.member' AND membership = 'join' AND {clause}
|
||||||
) AS b using (room_id)
|
) AS b using (room_id)
|
||||||
LIMIT 1
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
txn.execute(sql, (user_id, *args))
|
txn.execute(sql, (user_id, *args))
|
||||||
|
|
Loading…
Reference in New Issue