-
Notifications
You must be signed in to change notification settings - Fork 167
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: Lazy-loading room members on incremental sync (remember memberships) #17809
Open
MadLittleMods
wants to merge
31
commits into
develop
Choose a base branch
from
madlittlemods/sliding-sync-lazy-load-members-on-incrental-sync3
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+825
−58
Open
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
af9c72d
Correctly changes to required state config
erikjohnston 2fd3a5a
Add tests
erikjohnston 5e66e98
Newsfile
erikjohnston 596581a
Sliding Sync: Parameterize and add more tests for tracking changes to…
MadLittleMods 4b631a5
Apply suggestions from code review
erikjohnston e913037
Fixup
erikjohnston 35532d6
comment __bool__
erikjohnston 859d4a8
Fix handling of your own user ID
erikjohnston 56565dc
Remove unused var
erikjohnston 0d0207e
Remove TODOs
erikjohnston fafb2fe
Move comment down
erikjohnston c23d326
Clarify None comment
erikjohnston 6391b0f
LAZY only applies to memberships
erikjohnston fbe9894
Lazy-loading room members on incremental sync (remember memberships)
MadLittleMods b9a8780
Add changelog
MadLittleMods 760810f
Re-use `invalidated_state_keys`
MadLittleMods ddc9769
Better clarify `$ME` translation
MadLittleMods 8b906c4
Fill in TODO
MadLittleMods 2080cc5
Fix grammar
MadLittleMods 0087ad2
Move `prev_room_sync_config` up
MadLittleMods f8feef5
Move `prev_room_sync_config` up
MadLittleMods a566347
Merge branch 'develop' into erikj/ss_required_state
erikjohnston 4e662da
Comment why we're making new sets
MadLittleMods fb5bca4
Merge branch 'erikj/ss_required_state' into madlittlemods/sliding-syn…
MadLittleMods 7e667fe
Merge branch 'develop' into madlittlemods/sliding-sync-lazy-load-memb…
MadLittleMods aec7455
Limit the number of state_keys that we remember
MadLittleMods 87497c8
Update comments
MadLittleMods 525222b
Fix bug when requesting more than we can remember
MadLittleMods 90f0741
Merge branch 'develop' into madlittlemods/sliding-sync-lazy-load-memb…
MadLittleMods 96c9a91
Fix bug remembering too much when over limit
MadLittleMods cf13ca0
Merge branch 'develop' into madlittlemods/sliding-sync-lazy-load-memb…
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug with sliding sync where the server would not return state that was added to the `required_state` config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug with sliding sync where the server would not return state that was added to the `required_state` config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug with sliding sync where `$LAZY`-loading room members would not return `required_state` membership in incremental syncs. | ||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
More concretely: there's a few concerns I have:
On point 3. I think we can change the DB tables up a bit so that we have one table that holds the base values that apply to all live positions in the connection (there will be max two), and then another table that are the delta from the base to that position. This means that we'd only need to copy over the deltas to the base and insert new deltas whenever we persist a new position (which should be a lot less data).
I don't really know what we do about not pulling lots of data from the DB. We could only pull out that data for the rooms we're sending down? Or maybe we we don't pull it out and instead query the DB for "which of these users have we previously sent membership down for?", though that feels like a bigger change.
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.
This would probably be good to do in any case.
But it seems we're also concerned with how big an individual
(room_id, user_id)
could get.Are we set on wanting to track it? The dumb simple solution is to not track it at all which means returning a membership event for any
timeline
events.Another alternative is that we could throw away a
type
when thestate_key
's grow too large. Or just throw the wholerequired_state_map
when it grows too large. When I say throw-away, I just mean reset to whatever the requestedrequired_state_map
has. This is a decent middle ground between tracking nothing and everything. Ideally, we could kick out entries by recency but the complexity is probably not needed. It also doesn't require us to change our database schema.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 think we do want to track the sent memberships, otherwise you are often just doubling the number of events you have to pull out and send to the clients.
This is probably a decent idea that should be fairly easy to do? Even something like "if we have $LAZY and the set of members we've sent down is bigger than 100, reset", or something. It's not pretty but a) means for most rooms we'll never reset, and b) most of the time we won't send down redundant memberships.
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.
Updated to limit the
state_keys
we remember from previous requests to 100 for anytype
(also added tests).