summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-06-15 11:21:31 +0100
committerGitHub <noreply@github.com>2016-06-15 11:21:31 +0100
commitd9f7fa2e57f2e7a77745285092dfee5b2da7cb8d (patch)
tree55bc335fd79ebd35be0d6a131bdf4226684d4029 /synapse/handlers
parentMerge pull request #868 from matrix-org/erikj/invalid_id (diff)
parentCorrectly mark backfilled events as backfilled (diff)
downloadsynapse-d9f7fa2e57f2e7a77745285092dfee5b2da7cb8d.tar.xz
Merge pull request #869 from matrix-org/erikj/backfill_fix
Correctly mark backfilled events as backfilled
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index ff83c608e7..c2df43e2f6 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -345,19 +345,21 @@ class FederationHandler(BaseHandler):
         )
 
         missing_auth = required_auth - set(auth_events)
-        results = yield defer.gatherResults(
-            [
-                self.replication_layer.get_pdu(
-                    [dest],
-                    event_id,
-                    outlier=True,
-                    timeout=10000,
-                )
-                for event_id in missing_auth
-            ],
-            consumeErrors=True
-        ).addErrback(unwrapFirstError)
-        auth_events.update({a.event_id: a for a in results})
+        if missing_auth:
+            logger.info("Missing auth for backfill: %r", missing_auth)
+            results = yield defer.gatherResults(
+                [
+                    self.replication_layer.get_pdu(
+                        [dest],
+                        event_id,
+                        outlier=True,
+                        timeout=10000,
+                    )
+                    for event_id in missing_auth
+                ],
+                consumeErrors=True
+            ).addErrback(unwrapFirstError)
+            auth_events.update({a.event_id: a for a in results})
 
         ev_infos = []
         for a in auth_events.values():
@@ -399,7 +401,7 @@ class FederationHandler(BaseHandler):
             # previous to work out the state.
             # TODO: We can probably do something more clever here.
             yield self._handle_new_event(
-                dest, event
+                dest, event, backfilled=True,
             )
 
         defer.returnValue(events)