mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:16:09 -04:00
Ensure (room_id, next_batch_id)
is unique to avoid cross-talk/conflicts between batches (MSC2716) (#10877)
Part of [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) Part of https://github.com/matrix-org/synapse/issues/10737
This commit is contained in:
parent
0f007fe009
commit
9fd057b8c5
4 changed files with 43 additions and 4 deletions
|
@ -306,11 +306,13 @@ class RoomBatchSendEventRestServlet(RestServlet):
|
|||
# Verify the batch_id_from_query corresponds to an actual insertion event
|
||||
# and have the batch connected.
|
||||
corresponding_insertion_event_id = (
|
||||
await self.store.get_insertion_event_by_batch_id(batch_id_from_query)
|
||||
await self.store.get_insertion_event_by_batch_id(
|
||||
room_id, batch_id_from_query
|
||||
)
|
||||
)
|
||||
if corresponding_insertion_event_id is None:
|
||||
raise SynapseError(
|
||||
400,
|
||||
HTTPStatus.BAD_REQUEST,
|
||||
"No insertion event corresponds to the given ?batch_id",
|
||||
errcode=Codes.INVALID_PARAM,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue