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

Commit

Permalink
Only connect base insertion event to prev_event_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Jul 23, 2021
1 parent c9330ec commit a8c5311
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ async def on_POST(self, request, room_id):

events_to_create = body["events"]

prev_event_ids = prev_events_from_query
inherited_depth = await self._inherit_depth_from_prev_ids(
prev_events_from_query
)
Expand All @@ -516,6 +515,10 @@ async def on_POST(self, request, room_id):
chunk_id_to_connect_to = chunk_id_from_query
base_insertion_event = None
if chunk_id_from_query:
# All but the first base insertion event should point at a fake
# event, which causes the HS to ask for the state at the start of
# the chunk later.
prev_event_ids = [fake_prev_event_id]
# TODO: Verify the chunk_id_from_query corresponds to an insertion event
pass
# Otherwise, create an insertion event to act as a starting point.
Expand All @@ -526,6 +529,8 @@ async def on_POST(self, request, room_id):
# an insertion event), in which case we just create a new insertion event
# that can then get pointed to by a "marker" event later.
else:
prev_event_ids = prev_events_from_query

base_insertion_event_dict = self._create_insertion_event_dict(
sender=requester.user.to_string(),
room_id=room_id,
Expand Down

0 comments on commit a8c5311

Please sign in to comment.