From cec8ef58901ce1116e776c32edc81e31f82cb83e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 22 Apr 2022 14:26:59 +0100 Subject: [PATCH] add a TODO comment --- synapse/visibility.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/synapse/visibility.py b/synapse/visibility.py index 250f073597..de6d2ffc52 100644 --- a/synapse/visibility.py +++ b/synapse/visibility.py @@ -419,6 +419,13 @@ async def _event_to_memberships( return {} # for each event, get the event_ids of the membership state at those events. + # + # TODO: this means that we request the entire membership list. If there are only + # one or two users on this server, and the room is huge, this is very wasteful + # (it means more db work, and churns the *stateGroupMembersCache*). + # It might be that we could extend StateFilter to specify "give me keys matching + # *:", to avoid this. + event_to_state_ids = await storage.state.get_state_ids_for_events( frozenset(e.event_id for e in events), state_filter=StateFilter.from_types(types=((EventTypes.Member, None),)),