diff options
author | Eric Eastwood <erice@element.io> | 2021-09-28 21:23:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 21:23:16 -0500 |
commit | 9fd057b8c5a8c5748e7d8137d1485c38abd9602f (patch) | |
tree | cc5217c451f43f2cd61da15f851e3d0c7fab664d /synapse/rest/client/room_batch.py | |
parent | Update utility code to handle C implementations of frozendict (#10902) (diff) | |
download | synapse-9fd057b8c5a8c5748e7d8137d1485c38abd9602f.tar.xz |
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
Diffstat (limited to 'synapse/rest/client/room_batch.py')
-rw-r--r-- | synapse/rest/client/room_batch.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/rest/client/room_batch.py b/synapse/rest/client/room_batch.py index bf14ec384e..1dffcc3147 100644 --- a/synapse/rest/client/room_batch.py +++ b/synapse/rest/client/room_batch.py @@ -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, ) |