forked-synapse/synapse/storage
Eric Eastwood 11db575218
Sliding Sync: Use stream_ordering based timeline pagination for incremental sync (#17510)
Use `stream_ordering` based `timeline` pagination for incremental
`/sync` in Sliding Sync. Previously, we were always using a
`topological_ordering` but we should only be using that for historical
scenarios (initial `/sync`, newly joined, or haven't sent the room down
the connection before).

This is slightly different than what the [spec
suggests](https://spec.matrix.org/v1.10/client-server-api/#syncing)

> Events are ordered in this API according to the arrival time of the
event on the homeserver. This can conflict with other APIs which order
events based on their partial ordering in the event graph. This can
result in duplicate events being received (once per distinct API
called). Clients SHOULD de-duplicate events based on the event ID when
this happens.

But we've had a [discussion below in this
PR](https://github.com/element-hq/synapse/pull/17510#discussion_r1699105569)
and this matches what Sync v2 already does and seems like it makes
sense. Created a spec issue
https://github.com/matrix-org/matrix-spec/issues/1917 to clarify this.

Related issues:

 - https://github.com/matrix-org/matrix-spec/issues/1917
 - https://github.com/matrix-org/matrix-spec/issues/852
 - https://github.com/matrix-org/matrix-spec-proposals/pull/4033
2024-08-07 11:27:50 -05:00
..
controllers Add rooms.required_state to Sliding Sync /sync (#17342) 2024-07-04 12:25:36 -05:00
databases Sliding Sync: Use stream_ordering based timeline pagination for incremental sync (#17510) 2024-08-07 11:27:50 -05:00
engines Change allow_unsafe_locale to also apply on new databases (#17238) 2024-05-29 12:04:13 +01:00
schema Prepare for authenticated media freeze (#17433) 2024-07-22 10:33:17 +01:00
util Fix sync waiting for an invalid token from the "future" (#17386) 2024-07-02 12:39:49 +01:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
_base.py Sliding Sync: Update filters to be robust against remote invite rooms (#17450) 2024-07-30 13:20:29 -05:00
background_updates.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
database.py Move towards using MultiWriterIdGenerator everywhere (#17226) 2024-05-29 12:19:10 +00:00
keys.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
prepare_database.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
push_rule.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
roommember.py Use fully-qualified PersistedEventPosition when returning RoomsForUser (#17265) 2024-06-04 12:58:03 -05:00
types.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00