summary refs log tree commit diff
path: root/synapse/handlers/room_summary.py
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-04-23 17:53:52 +0200
committerRory& <root@rory.gay>2025-06-27 19:46:29 +0200
commit12f5c44e7d1cedc9f11402fc5c06ce54a8c24915 (patch)
treed7c1ce808a78c5bf295877bf60b87cf26b7285f5 /synapse/handlers/room_summary.py
parentHotfix: ignore rejected events in delayed_events (diff)
downloadsynapse-12f5c44e7d1cedc9f11402fc5c06ce54a8c24915.tar.xz
Add too much logging to room summary over federation
Signed-off-by: Rory& <root@rory.gay>
Diffstat (limited to 'synapse/handlers/room_summary.py')
-rw-r--r--synapse/handlers/room_summary.py40
1 files changed, 36 insertions, 4 deletions
diff --git a/synapse/handlers/room_summary.py b/synapse/handlers/room_summary.py

index 91b131d09b..6e64930682 100644 --- a/synapse/handlers/room_summary.py +++ b/synapse/handlers/room_summary.py
@@ -700,23 +700,55 @@ class RoomSummaryHandler: """ # The API doesn't return the room version so assume that a # join rule of knock is valid. + join_rule = room.get("join_rule") + world_readable = room.get("world_readable") + + logger.warning( + "[EMMA] Checking if room %s is accessible to %s: join_rule=%s, world_readable=%s", + room_id, requester, join_rule, world_readable + ) + if ( - room.get("join_rule", JoinRules.PUBLIC) - in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED) - or room.get("world_readable") is True + join_rule in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED) + or world_readable is True ): return True - elif not requester: + else: + logger.warning( + "[EMMA] Room %s is not accessible to %s: join_rule=%s, world_readable=%s, join_rule result=%s, world_readable result=%s", + room_id, requester, join_rule, world_readable, + join_rule in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED), + world_readable is True + ) + + if not requester: + logger.warning( + "[EMMA] No requester, so room %s is not accessible", + room_id + ) return False + # Check if the user is a member of any of the allowed rooms from the response. allowed_rooms = room.get("allowed_room_ids") + logger.warning( + "[EMMA] Checking if room %s is in allowed rooms for %s: join_rule=%s, allowed_rooms=%s", + requester, + room_id, + join_rule, + allowed_rooms + ) if allowed_rooms and isinstance(allowed_rooms, list): if await self._event_auth_handler.is_user_in_rooms( allowed_rooms, requester ): return True + logger.warning( + "[EMMA] Checking if room %s is accessble to %s via local state", + room_id, + requester + ) # Finally, check locally if we can access the room. The user might # already be in the room (if it was a child room), or there might be a # pending invite, etc.