From 97497955ea02f2a398d163f7de8ab592ffb5f2ab Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 22 May 2024 14:07:35 -0500 Subject: [PATCH] Update filter to be more precise and avoid more work - Added `room.account_data` and `room.presence` to avoid extra work in `_generate_sync_entry_for_rooms()` - Added a comment to the top-level `account_data` and `presence` filters that `(This is just here for good measure)` See https://github.com/element-hq/synapse/pull/17167#discussion_r1610517164 --- synapse/rest/client/sync.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/synapse/rest/client/sync.py b/synapse/rest/client/sync.py index 7b98aee60f..27ea943e31 100644 --- a/synapse/rest/client/sync.py +++ b/synapse/rest/client/sync.py @@ -638,14 +638,26 @@ class SlidingSyncE2eeRestServlet(RestServlet): "state": { "types": ["m.room.member"], }, + # We don't want any extra account_data generated because it's not + # returned by this endpoint. This helps us avoid work in + # `_generate_sync_entry_for_rooms()` + "account_data": { + "not_types": ["*"], + }, + # We don't want any extra ephemeral data generated because it's not + # returned by this endpoint. This helps us avoid work in + # `_generate_sync_entry_for_rooms()` + "ephemeral": { + "not_types": ["*"], + }, }, # We don't want any extra account_data generated because it's not - # returned by this endpoint + # returned by this endpoint. (This is just here for good measure) "account_data": { "not_types": ["*"], }, # We don't want any extra presence data generated because it's not - # returned by this endpoint + # returned by this endpoint. (This is just here for good measure) "presence": { "not_types": ["*"], },