瀏覽代碼

`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`.
Richard van der Hoff 2 年之前
父節點
當前提交
696acd3515
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      changelog.d/12005.misc
  2. 1 1
      synapse/handlers/federation_event.py

+ 1 - 0
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`.

+ 1 - 1
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