summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-01-17 13:33:54 +0000
committerErik Johnston <erik@matrix.org>2017-01-17 13:33:54 +0000
commit633f97151c6c7fa693b3de4addad641186b4ef02 (patch)
tree5d0ef80cd30bfe758240b8d25c4d1dda3bb14177 /synapse
parentFix couple of federation state bugs (diff)
downloadsynapse-633f97151c6c7fa693b3de4addad641186b4ef02.tar.xz
Check event is in state_map
Diffstat (limited to 'synapse')
-rw-r--r--synapse/state.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 294e0c2081..df9b6b3ccb 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -333,7 +333,7 @@ class StateHandler(object):
                     new_state = yield resolve_events(
                         state_groups_ids.values(),
                         state_map_factory=lambda ev_ids: self.store.get_events(
-                            ev_ids, get_prev_content=False
+                            ev_ids, get_prev_content=False, check_redacted=False,
                         ),
                     )
             else:
@@ -482,6 +482,8 @@ def _resolve_with_state_fac(unconflicted_state, conflicted_state,
         for event_id in event_ids
     )
 
+    logger.info("Asking for %d conflicted events", len(needed_events))
+
     state_map = yield state_map_factory(needed_events)
 
     auth_events = _create_auth_events_from_maps(
@@ -491,6 +493,8 @@ def _resolve_with_state_fac(unconflicted_state, conflicted_state,
     new_needed_events = set(auth_events.itervalues())
     new_needed_events -= needed_events
 
+    logger.info("Asking for %d auth events", len(new_needed_events))
+
     state_map_new = yield state_map_factory(new_needed_events)
     state_map.update(state_map_new)
 
@@ -515,13 +519,14 @@ def _create_auth_events_from_maps(unconflicted_state, conflicted_state, state_ma
 def _resolve_with_state(unconflicted_state, conflicted_state, auth_events,
                         state_map):
     conflicted_state = {
-        key: [state_map[ev_id] for ev_id in event_ids]
+        key: [state_map[ev_id] for ev_id in event_ids if ev_id in state_map]
         for key, event_ids in conflicted_state.items()
     }
 
     auth_events = {
         key: state_map[ev_id]
         for key, ev_id in auth_events.items()
+        if ev_id in state_map
     }
 
     try: