summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-03-15 15:34:13 +0000
committerErik Johnston <erik@matrix.org>2021-03-15 15:34:13 +0000
commit2e09e2163e6c8e699b95c63c9a2ce34d3486cb6f (patch)
tree93eca42184097526137b0f07ea81a0ee98e594c7
parentFix remaining mypy issues due to Twisted upgrade. (#9608) (diff)
downloadsynapse-2e09e2163e6c8e699b95c63c9a2ce34d3486cb6f.tar.xz
Only send catch up events if they're the latest in the room
-rw-r--r--synapse/storage/databases/main/transactions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/transactions.py b/synapse/storage/databases/main/transactions.py
index 0309661841..f14a133c0b 100644
--- a/synapse/storage/databases/main/transactions.py
+++ b/synapse/storage/databases/main/transactions.py
@@ -428,7 +428,8 @@ class TransactionStore(TransactionWorkerStore):
     ) -> List[str]:
         q = """
                 SELECT event_id FROM destination_rooms
-                 JOIN events USING (stream_ordering)
+                 INNER JOIN events USING (stream_ordering)
+                 INNER JOIN event_forward_extremities USING (event_id)
                 WHERE destination = ?
                   AND stream_ordering > ?
                 ORDER BY stream_ordering