-
Notifications
You must be signed in to change notification settings - Fork 190
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
Conversation
# 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`. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Co-authored-by: Eric Eastwood <[email protected]>
a435d62
to
ed4ce95
Compare
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]>
This is to make it easier to reuse the logic when adding support for the new tables