close
Skip to content

Sliding Sync: ensure $LAZY membership changes from state resets get sent down #18782

@MadLittleMods

Description

@MadLittleMods

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
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions