diff --git a/changelog.d/18605.bugfix b/changelog.d/18605.bugfix new file mode 100644 index 0000000000..516f09e502 --- /dev/null +++ b/changelog.d/18605.bugfix @@ -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. diff --git a/synapse/handlers/room_policy.py b/synapse/handlers/room_policy.py index dcfebb128c..170c477d6f 100644 --- a/synapse/handlers/room_policy.py +++ b/synapse/handlers/room_policy.py @@ -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", "" )