summary refs log tree commit diff
path: root/synapse/federation/federation_client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-05 16:31:13 +0000
committerErik Johnston <erik@matrix.org>2015-03-05 16:31:13 +0000
commit6dfd8c73fcdd727cd6589513e2b8059f779623ae (patch)
tree5a64d26a15824dd994e16d52885b2bc48b83ed12 /synapse/federation/federation_client.py
parentHandle if get_missing_pdu returns 400 or not all events. (diff)
downloadsynapse-6dfd8c73fcdd727cd6589513e2b8059f779623ae.tar.xz
Docs.
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r--synapse/federation/federation_client.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index b87c8a3bbb..11e2753fed 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -446,6 +446,20 @@ class FederationClient(FederationBase):
     @defer.inlineCallbacks
     def get_missing_events(self, destination, room_id, earliest_events_ids,
                            latest_events, limit, min_depth):
+        """Tries to fetch events we are missing. This is called when we receive
+        an event without having received all of its ancestors.
+
+        Args:
+            destination (str)
+            room_id (str)
+            earliest_events_ids (list): List of event ids. Effectively the
+                events we expected to receive, but haven't. `get_missing_events`
+                should only return events that didn't happen before these.
+            latest_events (list): List of events we have received that we don't
+                have all previous events for.
+            limit (int): Maximum number of events to return.
+            min_depth (int): Minimum depth of events tor return.
+        """
         try:
             content = yield self.transport_layer.get_missing_events(
                 destination=destination,
@@ -470,6 +484,8 @@ class FederationClient(FederationBase):
             if not e.code == 400:
                 raise
 
+            # We are probably hitting an old server that doesn't support
+            # get_missing_events
             signed_events = []
             have_gotten_all_from_destination = False