summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index e5deb8a9ef..2201cd977e 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -346,6 +346,8 @@ class FederationHandler(BaseHandler):
             event.get_pdu_json()
         )
 
+        handled_events = set()
+
         try:
             builder.event_id = self.event_factory.create_event_id()
             builder.origin = self.hs.hostname
@@ -371,6 +373,10 @@ class FederationHandler(BaseHandler):
             auth_chain = ret["auth_chain"]
             auth_chain.sort(key=lambda e: e.depth)
 
+            handled_events.update([s.event_id for s in state])
+            handled_events.update([a.event_id for a in auth_chain])
+            handled_events.add(new_event.event_id)
+
             logger.debug("do_invite_join auth_chain: %s", auth_chain)
             logger.debug("do_invite_join state: %s", state)
 
@@ -426,6 +432,9 @@ class FederationHandler(BaseHandler):
             del self.room_queues[room_id]
 
             for p, origin in room_queue:
+                if p.event_id in handled_events:
+                    continue
+
                 try:
                     self.on_receive_pdu(origin, p, backfilled=False)
                 except: