mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 11:34:15 -04:00
Verify ?chunk_id
actually corresponds to an insertion event that exists (MSC2716) (#10776)
This commit is contained in:
parent
1c555527b3
commit
145c006ef7
4 changed files with 51 additions and 1 deletions
|
@ -300,7 +300,18 @@ class RoomBatchSendEventRestServlet(RestServlet):
|
|||
# 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
|
||||
|
||||
# Verify the chunk_id_from_query corresponds to an actual insertion event
|
||||
# and have the chunk connected.
|
||||
corresponding_insertion_event_id = (
|
||||
await self.store.get_insertion_event_by_chunk_id(chunk_id_from_query)
|
||||
)
|
||||
if corresponding_insertion_event_id is None:
|
||||
raise SynapseError(
|
||||
400,
|
||||
"No insertion event corresponds to the given ?chunk_id",
|
||||
errcode=Codes.INVALID_PARAM,
|
||||
)
|
||||
pass
|
||||
# Otherwise, create an insertion event to act as a starting point.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue