summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-09-13 15:33:16 +0100
committerErik Johnston <erik@matrix.org>2018-09-13 15:44:12 +0100
commit89a76d18898a0172010c25e5a7c66d57c16b9196 (patch)
tree030ab431c73868185687a09cf464453713846e45 /synapse/events
parentAttempt to figure out what's going on with timeouts (#3857) (diff)
downloadsynapse-89a76d18898a0172010c25e5a7c66d57c16b9196.tar.xz
Fix handling of redacted events from federation
If we receive an event that doesn't pass their content hash check (e.g.
due to already being redacted) then we hit a bug which causes an
exception to be raised, which then promplty stops the event (and
request) from being processed.

This effects all sorts of federation APIs, including joining rooms with
a redacted state event.
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 51f9084b90..b782af6308 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import six
+
 from synapse.util.caches import intern_dict
 from synapse.util.frozenutils import freeze
 
@@ -147,6 +149,9 @@ class EventBase(object):
     def items(self):
         return list(self._event_dict.items())
 
+    def keys(self):
+        return six.iterkeys(self._event_dict)
+
 
 class FrozenEvent(EventBase):
     def __init__(self, event_dict, internal_metadata_dict={}, rejected_reason=None):