summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-02-17 11:59:26 +0000
committerGitHub <noreply@github.com>2022-02-17 11:59:26 +0000
commit696acd35151ff32bb69e555baee4e584c504d4d6 (patch)
tree2ee29bea8c8c75353abb069e9a26e9c9e32a9883
parentPrevent duplicate push notifications for room reads (#11835) (diff)
downloadsynapse-696acd35151ff32bb69e555baee4e584c504d4d6.tar.xz
`send_join` response: get create event from `state`, not `auth_chain` (#12005)
msc3706 proposes changing the `/send_join` response:

> Any events returned within `state` can be omitted from `auth_chain`.

Currently, we rely on `m.room.create` being returned in `auth_chain`, but since
the `m.room.create` event must necessarily be part of the state, the above
change will break this.

In short, let's look for `m.room.create` in `state` rather than `auth_chain`.
-rw-r--r--changelog.d/12005.misc1
-rw-r--r--synapse/handlers/federation_event.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/12005.misc b/changelog.d/12005.misc
new file mode 100644
index 0000000000..45e21dbe59
--- /dev/null
+++ b/changelog.d/12005.misc
@@ -0,0 +1 @@
+Preparation for faster-room-join work: when parsing the `send_join` response, get the `m.room.create` event from `state`, not `auth_chain`.
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index 6dc27a38f3..7683246bef 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -420,7 +420,7 @@ class FederationEventHandler:
             SynapseError if the response is in some way invalid.
         """
         create_event = None
-        for e in auth_events:
+        for e in state:
             if (e.type, e.state_key) == (EventTypes.Create, ""):
                 create_event = e
                 break