Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit cbe01cc

Browse files
author
David Robertson
authored
Reject history insertion during partial joins (#14291)
1 parent 40fa829 commit cbe01cc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.d/14291.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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)).

synapse/rest/client/room_batch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ async def on_POST(
108108
errcode=Codes.MISSING_PARAM,
109109
)
110110

111+
if await self.store.is_partial_state_room(room_id):
112+
raise SynapseError(
113+
HTTPStatus.BAD_REQUEST,
114+
"Cannot insert history batches until we have fully joined the room",
115+
errcode=Codes.UNABLE_DUE_TO_PARTIAL_STATE,
116+
)
117+
111118
# Verify the batch_id_from_query corresponds to an actual insertion event
112119
# and have the batch connected.
113120
if batch_id_from_query:

0 commit comments

Comments
 (0)