mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Reject history insertion during partial joins (#14291)
This commit is contained in:
parent
40fa8294e3
commit
cbe01ccc3f
1
changelog.d/14291.bugfix
Normal file
1
changelog.d/14291.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Prevent history insertion ([MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716)) during an partial join ([MSC3706](https://github.com/matrix-org/matrix-spec-proposals/pull/3706)).
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user