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

Commit ba882c0

Browse files
reivilibresquahtx
andauthored
Faster Room Joins: fix /make_knock blocking indefinitely when the room in question is a partial-stated room. (#13583)
Co-authored-by: Sean Quah <[email protected]>
1 parent 7af07f9 commit ba882c0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

changelog.d/13583.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Faster Room Joins: fix `/make_knock` blocking indefinitely when the room in question is a partial-stated room.

synapse/federation/federation_server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,17 @@ async def on_make_knock_request(
763763
The partial knock event.
764764
"""
765765
origin_host, _ = parse_server_name(origin)
766+
767+
if await self.store.is_partial_state_room(room_id):
768+
# Before we do anything: check if the room is partial-stated.
769+
# Note that at the time this check was added, `on_make_knock_request` would
770+
# block due to https://github.com/matrix-org/synapse/issues/12997.
771+
raise SynapseError(
772+
404,
773+
"Unable to handle /make_knock right now; this server is not fully joined.",
774+
errcode=Codes.NOT_FOUND,
775+
)
776+
766777
await self.check_server_matches_acl(origin_host, room_id)
767778

768779
room_version = await self.store.get_room_version(room_id)

0 commit comments

Comments
 (0)