remote join processing: get create event from state, not auth_chain (#12039)

A follow-up to #12005, in which I apparently missed that there are a bunch of other places that assume the create event is in the auth chain.
This commit is contained in:
Richard van der Hoff 2022-02-21 19:27:35 +00:00 committed by GitHub
parent a85dde3445
commit 3070af4809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View file

@ -1498,7 +1498,7 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore):
self._event_reports_id_gen = IdGenerator(db_conn, "event_reports", "id")
async def upsert_room_on_join(
self, room_id: str, room_version: RoomVersion, auth_events: List[EventBase]
self, room_id: str, room_version: RoomVersion, state_events: List[EventBase]
) -> None:
"""Ensure that the room is stored in the table
@ -1511,7 +1511,7 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore):
has_auth_chain_index = await self.has_auth_chain_index(room_id)
create_event = None
for e in auth_events:
for e in state_events:
if (e.type, e.state_key) == (EventTypes.Create, ""):
create_event = e
break