From 25815841b197964703312c3f96fac728e8b1f4a2 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 24 Sep 2019 17:24:28 +0100 Subject: [PATCH] Consider every room as having no retention policy if the feature is disabled --- synapse/storage/room.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synapse/storage/room.py b/synapse/storage/room.py index eba4acd758..db3d052d33 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -238,6 +238,14 @@ def get_retention_policy_for_room(self, room_id): Returns: dict[int, int]: "min_lifetime" and "max_lifetime" for this room. """ + # If the room retention feature is disabled, return a policy with no minimum nor + # maximum, in order not to filter out events we should filter out when sending to + # the client. + if not self.config.retention_enabled: + defer.returnValue({ + "min_lifetime": None, + "max_lifetime": None, + }) def get_retention_policy_for_room_txn(txn): txn.execute(