summary refs log tree commit diff
path: root/synapse/rest/client/room_batch.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-10-27 10:52:23 +0100
committerGitHub <noreply@github.com>2022-10-27 10:52:23 +0100
commitcbe01ccc3f9c09a0a7233f90200fbcb8ae5245cf (patch)
tree06644d2856fae5841e7f6c2e8830f3f73a55efe9 /synapse/rest/client/room_batch.py
parentRefactor MSC3030 `/timestamp_to_event` to move away from our snowflake pull f... (diff)
downloadsynapse-cbe01ccc3f9c09a0a7233f90200fbcb8ae5245cf.tar.xz
Reject history insertion during partial joins (#14291)
Diffstat (limited to 'synapse/rest/client/room_batch.py')
-rw-r--r--synapse/rest/client/room_batch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/rest/client/room_batch.py b/synapse/rest/client/room_batch.py
index dd91dabedd..10be4a781b 100644
--- a/synapse/rest/client/room_batch.py
+++ b/synapse/rest/client/room_batch.py
@@ -108,6 +108,13 @@ class RoomBatchSendEventRestServlet(RestServlet):
                 errcode=Codes.MISSING_PARAM,
             )
 
+        if await self.store.is_partial_state_room(room_id):
+            raise SynapseError(
+                HTTPStatus.BAD_REQUEST,
+                "Cannot insert history batches until we have fully joined the room",
+                errcode=Codes.UNABLE_DUE_TO_PARTIAL_STATE,
+            )
+
         # Verify the batch_id_from_query corresponds to an actual insertion event
         # and have the batch connected.
         if batch_id_from_query: