forked-synapse/synapse
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
..
_scripts Prepare for authenticated media freeze (#17433) 2024-07-22 10:33:17 +01:00
api Fixup sliding sync comment (#17531) 2024-08-07 10:32:36 +01:00
app Make sure we use the right logic for enabling the media repo. (#17424) 2024-07-15 11:42:59 +02:00
appservice Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
config Fixed presence results not returning offline users on initial sync (#17231) 2024-07-23 09:59:24 +00:00
crypto Only do one concurrent fetch per server in keyring (#16894) 2024-02-09 10:51:11 +00:00
events Sliding Sync: Update filters to be robust against remote invite rooms (#17450) 2024-07-30 13:20:29 -05:00
federation Fix new media APIs when using synapse.app.media_repository (#17420) 2024-07-09 18:29:32 +01:00
handlers Sliding Sync: Use stream_ordering based timeline pagination for incremental sync (#17510) 2024-08-07 11:27:50 -05:00
http Merge branch 'master' into develop 2024-07-30 17:10:46 +01:00
logging Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
media Prepare for authenticated media freeze (#17433) 2024-07-22 10:33:17 +01:00
metrics Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
module_api Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
push Fix room type typo in mailer (#17336) 2024-06-24 10:02:16 -05:00
replication Reintroduce "Reduce device lists replication traffic."" (#17361) 2024-06-25 10:34:34 +01:00
res Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
rest Sliding Sync: Add more tracing (#17514) 2024-08-06 11:43:43 -05:00
server_notices Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
spam_checker_api Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
state Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage Sliding Sync: Use stream_ordering based timeline pagination for incremental sync (#17510) 2024-08-07 11:27:50 -05:00
streams Fix regression when bounding future tokens (#17391) 2024-07-02 14:06:36 +01:00
synapse_rust Add event.internal_metadata.instance_name (#17300) 2024-06-13 11:32:50 -05:00
types Sliding Sync: Add typing notification extension (MSC3961) (#17505) 2024-07-31 13:20:23 -05:00
util Speed up SS room sorting (#17468) 2024-07-23 14:03:14 +01:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
_pydantic_compat.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
event_auth.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
notifier.py Reduce volume of 'Waiting for current token' logs, which were introduced in v1.109.0. (#17428) 2024-07-23 11:51:34 +01:00
py.typed
server.py Sliding Sync: Track whether we have sent rooms down to clients (#17447) 2024-07-29 22:45:48 +01:00
visibility.py Include user membership on events (#17282) 2024-06-13 21:45:54 +00:00