summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-05-21 16:10:54 +0100
committerGitHub <noreply@github.com>2019-05-21 16:10:54 +0100
commitc4aef549ad1f55661675a789f89fe9e041fac874 (patch)
tree0a9c7e729a74219965da16eb9b9df88ebe98e994 /synapse/storage/events.py
parentPin eliot to <1.8 on python 3.5.2 (#5218) (diff)
downloadsynapse-c4aef549ad1f55661675a789f89fe9e041fac874.tar.xz
Exclude soft-failed events from fwd-extremity candidates. (#5146)
When considering the candidates to be forward-extremities, we must exclude soft
failures.

Hopefully fixes #5090.

Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 881d6d0126..2ffc27ff41 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -575,10 +575,11 @@ class EventsStore(
 
         def _get_events(txn, batch):
             sql = """
-            SELECT prev_event_id
+            SELECT prev_event_id, internal_metadata
             FROM event_edges
                 INNER JOIN events USING (event_id)
                 LEFT JOIN rejections USING (event_id)
+                LEFT JOIN event_json USING (event_id)
             WHERE
                 prev_event_id IN (%s)
                 AND NOT events.outlier
@@ -588,7 +589,11 @@ class EventsStore(
             )
 
             txn.execute(sql, batch)
-            results.extend(r[0] for r in txn)
+            results.extend(
+                r[0]
+                for r in txn
+                if not json.loads(r[1]).get("soft_failed")
+            )
 
         for chunk in batch_iter(event_ids, 100):
             yield self.runInteraction("_get_events_which_are_prevs", _get_events, chunk)