-
Notifications
You must be signed in to change notification settings - Fork 412
Sliding Sync: Use stream_ordering based timeline pagination for incremental sync
#17510
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
Changes 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
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix timeline ordering (using `stream_ordering` instead of topological ordering) in experimental [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575) Sliding Sync `/sync` endpoint. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1855,18 +1855,19 @@ async def get_room_sync_data( | |
| room_membership_for_user_at_to_token.event_pos.to_room_stream_token() | ||
| ) | ||
|
|
||
| timeline_events, new_room_key = await self.store.paginate_room_events( | ||
| room_id=room_id, | ||
| # The bounds are reversed so we can paginate backwards | ||
| # (from newer to older events) starting at to_bound. | ||
| # This ensures we fill the `limit` with the newest events first, | ||
| from_key=to_bound, | ||
| to_key=from_bound, | ||
| direction=Direction.BACKWARDS, | ||
| # We add one so we can determine if there are enough events to saturate | ||
| # the limit or not (see `limited`) | ||
| limit=room_sync_config.timeline_limit + 1, | ||
| event_filter=None, | ||
| timeline_events, new_room_key = ( | ||
| await self.store.get_room_events_stream_for_room( | ||
|
||
| room_id=room_id, | ||
| # The bounds are reversed so we can paginate backwards | ||
| # (from newer to older events) starting at to_bound. | ||
| # This ensures we fill the `limit` with the newest events first, | ||
| from_key=to_bound, | ||
| to_key=from_bound, | ||
| direction=Direction.BACKWARDS, | ||
| # We add one so we can determine if there are enough events to saturate | ||
| # the limit or not (see `limited`) | ||
| limit=room_sync_config.timeline_limit + 1, | ||
| ) | ||
|
||
| ) | ||
|
|
||
| # We want to return the events in ascending order (the last event is the | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.