From b071426a63ef7dffbf25f96c747290117c19bdca Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 15 Dec 2021 23:12:37 -0600 Subject: Plumb allow_no_prev_events through for MSC2716 --- synapse/handlers/room_batch.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'synapse/handlers/room_batch.py') diff --git a/synapse/handlers/room_batch.py b/synapse/handlers/room_batch.py index c4d22ad297..f09714a85f 100644 --- a/synapse/handlers/room_batch.py +++ b/synapse/handlers/room_batch.py @@ -182,7 +182,7 @@ class RoomBatchHandler: # bunch of `@mxid joined the room` noise between each batch prev_event_ids_for_state_chain: List[str] = [] - for state_event in state_events_at_start: + for index, state_event in enumerate(state_events_at_start): assert_params_in_dict( state_event, ["type", "origin_server_ts", "content", "sender"] ) @@ -218,6 +218,9 @@ class RoomBatchHandler: content=event_dict["content"], outlier=True, historical=True, + # Only the first even in the chain should be floating. + # The rest should hang off each other in a chain. + allow_no_prev_events=index == 0, prev_event_ids=prev_event_ids_for_state_chain, # Make sure to use a copy of this list because we modify it # later in the loop here. Otherwise it will be the same @@ -238,6 +241,9 @@ class RoomBatchHandler: event_dict, outlier=True, historical=True, + # Only the first even in the chain should be floating. + # The rest should hang off each other in a chain. + allow_no_prev_events=index == 0, prev_event_ids=prev_event_ids_for_state_chain, # Make sure to use a copy of this list because we modify it # later in the loop here. Otherwise it will be the same -- cgit 1.5.1