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.
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: Use
stream_ordering
based timeline pagination for incremental sync #17510Sliding Sync: Use
stream_ordering
based timeline pagination for incremental sync #17510Changes from 9 commits
75e464b
c5966e5
3423f83
f781e5b
4aee1ab
cba4664
d6dd34f
3075a15
d67c9b5
efcc915
0e12dde
6231fb0
c5d0998
3540ac7
f27e145
a67b573
0874a2e
c98e8b1
4888d44
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As an alternative, we could adapt
paginate_room_events(...)
to conditionally usetopological_ordering
vsstream_ordering
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.
There is a possible question of, do we even want to do this?
Using
stream_ordering
makes sense in terms of/sync
returning new items that the server received. it's also what the spec says we should do. We also make sure that if a new event is received, it's returned to the client. Otherwise, it seems like there is an edge case if we usetopological_ordering
that a new event might not be returned because it's topological position is calculated to be older.Using
topological_ordering
makes sense in terms of matching/messages
so people don't have to worry about different orders of things between API's.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.
Yeah, so the way that sync v2 works in synapse currently is:
/sync
we usepaginate_room_events
to get a chunk of history for the client, this basically results in the same as if no history was sent down/messages
was used.get_room_events_stream_for_rooms
to get all updates for rooms since the last/sync
, which is in stream ordering.I think this is probably the right way of looking at it, we use topological ordering when we paginate backwards, but stream ordering to fetch new updates to the room (even if those updates happened a while ago in the past).
What we probably want to do for sliding sync is to more or less replicate that behaviour: when we have an incremental fetch all updates (i.e.
get_room_events_stream_for_rooms
for joined rooms and fetch all membership changes), and then only usepaginate_room_events
for the new rooms.(This also has the advantage we'd only need to sort and filter rooms we know have updates)
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.
Sounds pretty reasonable to me 👍
I've created a spec issue to track this: matrix-org/matrix-spec#1917