Avoid generating state groups for local out-of-band leaves (#12154)

If we locally generate a rejection for an invite received over federation, it
is stored as an outlier (because we probably don't have the state for the
room). However, currently we still generate a state group for it (even though
the state in that state group will be nonsense).

By setting the `outlier` param on `create_event`, we avoid the nonsensical
state.
This commit is contained in:
Richard van der Hoff 2022-03-03 19:58:08 +00:00 committed by GitHub
parent fb0ffa9676
commit 8533c8b03d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/12154.misc Normal file
View File

@ -0,0 +1 @@
Avoid generating state groups for local out-of-band leaves.

View File

@ -1736,8 +1736,8 @@ class RoomMemberMasterHandler(RoomMemberHandler):
txn_id=txn_id, txn_id=txn_id,
prev_event_ids=prev_event_ids, prev_event_ids=prev_event_ids,
auth_event_ids=auth_event_ids, auth_event_ids=auth_event_ids,
outlier=True,
) )
event.internal_metadata.outlier = True
event.internal_metadata.out_of_band_membership = True event.internal_metadata.out_of_band_membership = True
result_event = await self.event_creation_handler.handle_new_client_event( result_event = await self.event_creation_handler.handle_new_client_event(