summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-08-17 13:13:42 +0100
committerGitHub <noreply@github.com>2021-08-17 13:13:42 +0100
commit272b89d547a80628fd90ed35953d2d7c95410b65 (patch)
treee00b5c9d4d1b0d61ad6e92690970d71d13a0e162 /synapse/handlers/federation.py
parentFlatten the synapse.rest.client package (#10600) (diff)
downloadsynapse-272b89d547a80628fd90ed35953d2d7c95410b65.tar.xz
Stop setting the outlier flag for things that aren't (#10614)
Marking things as outliers to inhibit pushes is a sledgehammer to crack a
nut. Move the test further down the stack so that we just inhibit the thing we
want.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/federation.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index c0e13bdaac..a257d87fed 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -293,13 +293,7 @@ class FederationHandler(BaseHandler):
             prevs = set(pdu.prev_event_ids())
             seen = await self.store.have_events_in_timeline(prevs)
 
-            if min_depth is not None and pdu.depth < min_depth:
-                # This is so that we don't notify the user about this
-                # message, to work around the fact that some events will
-                # reference really really old events we really don't want to
-                # send to the clients.
-                pdu.internal_metadata.outlier = True
-            elif min_depth is not None and pdu.depth > min_depth:
+            if min_depth is not None and pdu.depth > min_depth:
                 missing_prevs = prevs - seen
                 if sent_to_us_directly and missing_prevs:
                     # If we're missing stuff, ensure we only fetch stuff one
@@ -2375,6 +2369,7 @@ class FederationHandler(BaseHandler):
                 not event.internal_metadata.is_outlier()
                 and not backfilled
                 and not context.rejected
+                and (await self.store.get_min_depth(event.room_id)) <= event.depth
             ):
                 await self.action_generator.handle_push_actions_for_event(
                     event, context