From 696acd35151ff32bb69e555baee4e584c504d4d6 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Thu, 17 Feb 2022 11:59:26 +0000 Subject: [PATCH] `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`. --- changelog.d/12005.misc | 1 + synapse/handlers/federation_event.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/12005.misc diff --git a/changelog.d/12005.misc b/changelog.d/12005.misc new file mode 100644 index 000000000..45e21dbe5 --- /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 6dc27a38f..7683246be 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