Split out from #17929 (comment), as explained by @erikjohnston,
In state reset scenarios where a membership gets reverted to a previous state, we won't have an event in the timeline, but will have a state change in the state deltas. Currently, the $LAZY membership logic only looks in the timeline so we will miss this kind of change.
|
# We need to fetch all relevant people when we're lazy-loading membership |
|
elif ( |
|
state_type == EventTypes.Member |
|
and state_key == StateValues.LAZY |
|
): |
|
lazy_load_room_members = True |
|
|
|
# Everyone in the timeline is relevant |
|
timeline_membership: Set[str] = set() |
|
if timeline_events is not None: |
|
for timeline_event in timeline_events: |
|
# Anyone who sent a message is relevant |
|
timeline_membership.add(timeline_event.sender) |
|
|
|
# We also care about invite, ban, kick, targets, |
|
# etc. |
|
if timeline_event.type == EventTypes.Member: |
|
timeline_membership.add( |
|
timeline_event.state_key |
|
) |
Split out from #17929 (comment), as explained by @erikjohnston,
In state reset scenarios where a membership gets reverted to a previous state, we won't have an event in the
timeline, but will have a state change in the state deltas. Currently, the$LAZYmembership logic only looks in thetimelineso we will miss this kind of change.synapse/synapse/handlers/sliding_sync/__init__.py
Lines 1044 to 1063 in 8306cee