Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sliding Sync: Split up get_room_membership_for_user_at_to_token #17629

Merged
merged 5 commits into from
Sep 1, 2024

Conversation

erikjohnston
Copy link
Member

This is to make it easier to reuse the logic when adding support for the new tables

@erikjohnston erikjohnston marked this pull request as ready for review August 29, 2024 18:14
@erikjohnston erikjohnston requested a review from a team as a code owner August 29, 2024 18:14
synapse/handlers/sliding_sync/room_lists.py Outdated Show resolved Hide resolved
synapse/handlers/sliding_sync/room_lists.py Outdated Show resolved Hide resolved
Comment on lines 648 to 650
# Note: The `room_for_user` we're assigning here will need to be fixed up
# (below) because they are potentially from the current snapshot time
# instead from the time of the `to_token`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this comment is accurate anymore since we just did the rewind above and only create the _RoomMembershipForUser once we have all of the info

event_pos=room_for_user.event_pos,
membership=room_for_user.membership,
sender=room_for_user.sender,
# We will update these fields below to be accurate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

event_pos=left_event_pos,
membership=Membership.LEAVE,
sender=None,
# We will update these fields below to be accurate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment


# 1) Fetch membership changes that fall in the range from `to_token` up to
# - a) Remove rooms that the user joined after the `to_token`
# - b) Add back rooms that the user left after the `to_token`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b) Add back rooms that the user left after the to_token

I think this is outdated and we don't do this anymore 🤔

We just do c since the filtering that would have removed the left rooms was separated out to filter_rooms_relevant_for_sync/filter_membership_for_sync

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 1b) and 1c) references need to be updated now that it was shuffled.

@erikjohnston erikjohnston merged commit 560b43a into develop Sep 1, 2024
77 checks passed
@erikjohnston erikjohnston deleted the erikj/ss_room_list_split branch September 1, 2024 09:52
erikjohnston added a commit that referenced this pull request Sep 1, 2024
Based on #17629

Utilizing the new sliding sync tables added in
#17512 for fast acquisition of
rooms for the user and filtering/sorting.

---------

Co-authored-by: Eric Eastwood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants