summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-14 16:50:37 +0100
committerGitHub <noreply@github.com>2016-09-14 16:50:37 +0100
commit264a48aedf1d73e1abde834aa270c0240e7da623 (patch)
tree97e62eeca42faaaaa79ad58f43849cab42896d03 /synapse/handlers/federation.py
parentMerge pull request #1118 from matrix-org/erikj/public_rooms_splitout (diff)
parentAmalgamate two identical consecutive if statements (diff)
downloadsynapse-264a48aedf1d73e1abde834aa270c0240e7da623.tar.xz
Merge pull request #1117 from matrix-org/erikj/fix_state
Ensure we don't mutate state cache entries
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 8a1038c44a..f7cb3c1bb2 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1585,10 +1585,12 @@ class FederationHandler(BaseHandler):
                 current_state = set(e.event_id for e in auth_events.values())
                 different_auth = event_auth_events - current_state
 
+                context.current_state_ids = dict(context.current_state_ids)
                 context.current_state_ids.update({
                     k: a.event_id for k, a in auth_events.items()
                     if k != event_key
                 })
+                context.prev_state_ids = dict(context.prev_state_ids)
                 context.prev_state_ids.update({
                     k: a.event_id for k, a in auth_events.items()
                 })
@@ -1670,10 +1672,12 @@ class FederationHandler(BaseHandler):
                 # 4. Look at rejects and their proofs.
                 # TODO.
 
+                context.current_state_ids = dict(context.current_state_ids)
                 context.current_state_ids.update({
                     k: a.event_id for k, a in auth_events.items()
                     if k != event_key
                 })
+                context.prev_state_ids = dict(context.prev_state_ids)
                 context.prev_state_ids.update({
                     k: a.event_id for k, a in auth_events.items()
                 })