summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-09 14:50:10 -0500
committerEric Eastwood <erice@element.io>2022-08-09 14:50:10 -0500
commit2a467fd26b369d937a04da950d9ecaf8f23aa382 (patch)
treef2c9f654a0f67d7bbcdf459b9b4a918923d041ca /synapse/handlers/federation.py
parentOnly set attribute if going forward (diff)
parentMerge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry (diff)
downloadsynapse-2a467fd26b369d937a04da950d9ecaf8f23aa382.tar.xz
Merge branch 'madlittlemods/11850-migrate-to-opentelemetry' into madlittlemods/13356-messages-investigation-scratch-v1
Conflicts:
	pyproject.toml
	synapse/logging/tracing.py
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py

index a27f9f6246..39be782937 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py
@@ -756,6 +756,23 @@ class FederationHandler: # (and return a 404 otherwise) room_version = await self.store.get_room_version(room_id) + if await self.store.is_partial_state_room(room_id): + # If our server is still only partially joined, we can't give a complete + # response to /make_join, so return a 404 as we would if we weren't in the + # room at all. + # The main reason we can't respond properly is that we need to know about + # the auth events for the join event that we would return. + # We also should not bother entertaining the /make_join since we cannot + # handle the /send_join. + logger.info( + "Rejecting /make_join to %s because it's a partial state room", room_id + ) + raise SynapseError( + 404, + "Unable to handle /make_join right now; this server is not fully joined.", + errcode=Codes.NOT_FOUND, + ) + # now check that we are *still* in the room is_in_room = await self._event_auth_handler.check_host_in_room( room_id, self.server_name