Skip processing policy server events through policy server (#18605)

Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
This commit is contained in:
Travis Ralston
2025-06-30 04:45:23 -06:00
committed by GitHub
parent bfb3a6e700
commit b35c6483d5
2 changed files with 4 additions and 0 deletions

1
changelog.d/18605.bugfix Normal file
View File

@@ -0,0 +1 @@
Ensure policy servers are not asked to scan policy server change events, allowing rooms to disable the use of a policy server while the policy server is down.

View File

@@ -54,6 +54,9 @@ class RoomPolicyHandler:
Returns:
bool: True if the event is allowed in the room, False otherwise.
"""
if event.type == "org.matrix.msc4284.policy" and event.state_key is not None:
return True # always allow policy server change events
policy_event = await self._storage_controllers.state.get_current_state_event(
event.room_id, "org.matrix.msc4284.policy", ""
)