Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
send_join response: get create event from state, not auth_chain (
Browse files Browse the repository at this point in the history
…#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`.
  • Loading branch information
richvdh authored Feb 17, 2022
1 parent 4077177 commit 696acd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/12005.misc
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 1 addition & 1 deletion synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ async def process_remote_join(
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
Expand Down

0 comments on commit 696acd3

Please sign in to comment.