summary refs log tree commit diff
path: root/synapse/federation/federation_server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-01-30 13:34:01 +0000
committerErik Johnston <erik@matrix.org>2015-01-30 13:34:01 +0000
commita70a801184814d116ed5b10a952e17c45df7bfc8 (patch)
tree5242d53c0babb5699ae16a1692bdcd20f7b54942 /synapse/federation/federation_server.py
parentRevert accidental bumping of angluar_sdk dep (diff)
downloadsynapse-a70a801184814d116ed5b10a952e17c45df7bfc8.tar.xz
Fix bug where we superfluously asked for current state. Change API of /query_auth/ so that we don't duplicate events in the response.
Diffstat (limited to 'synapse/federation/federation_server.py')
-rw-r--r--synapse/federation/federation_server.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index 845a07a3a3..84ed0a0ba0 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -252,11 +252,8 @@ class FederationServer(object):
                 e.get_pdu_json(time_now)
                 for e in ret["auth_chain"]
             ],
-            "rejects": content.get("rejects", []),
-            "missing": [
-                e.get_pdu_json(time_now)
-                for e in ret.get("missing", [])
-            ],
+            "rejects": ret.get("rejects", []),
+            "missing": ret.get("missing", []),
         }
 
         defer.returnValue(
@@ -372,7 +369,10 @@ class FederationServer(object):
                             logger.exception("Failed to get PDU")
                             fetch_state = True
             else:
-                fetch_state = True
+                prevs = {e_id for e_id, _ in pdu.prev_events}
+                seen = set(have_seen.keys())
+                if prevs - seen:
+                    fetch_state = True
         else:
             fetch_state = True