summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-11-28 19:26:13 +0000
committerBrendan Abolivier <babolivier@matrix.org>2019-11-28 19:26:26 +0000
commit708cef88cfbf8dd6df44d2da4ab4dbc7eb584f74 (patch)
tree664a99808b8c6bb1718bb05464944b69e4c3972c /synapse/handlers
parentRemove local threepids on account deactivation (#6426) (diff)
downloadsynapse-708cef88cfbf8dd6df44d2da4ab4dbc7eb584f74.tar.xz
Discard retention policies when retrieving state
Purge jobs don't delete the latest event in a room in order to keep the forward extremity and not break the room. On the other hand, get_state_events, when given an at_token argument calls filter_events_for_client to know if the user can see the event that matches that (sync) token. That function uses the retention policies of the events it's given to filter out those that are too old from a client's view.

Some clients, such as Riot, when loading a room, request the list of members for the latest sync token it knows about, and get confused to the point of refusing to send any message if the server tells it that it can't get that information. This can happen very easily with the message retention feature turned on and a room with low activity so that the last event sent becomes too old according to the room's retention policy.

An easy and clean fix for that issue is to discard the room's retention policies when retrieving state.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 155ed6e06a..3b0156f516 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -138,7 +138,7 @@ class MessageHandler(object):
                 raise NotFoundError("Can't find event for token %s" % (at_token,))
 
             visible_events = yield filter_events_for_client(
-                self.storage, user_id, last_events
+                self.storage, user_id, last_events, apply_retention_policies=False
             )
 
             event = last_events[0]