Clarify order of initial vs incremental /sync
#1917
Labels
clarification
An area where the expected behaviour is understood, but the spec could do with being more explicit
Link to problem area:
Spec: https://spec.matrix.org/v1.10/client-server-api/#syncing
Issue
Spawning from a discussion with @erikjohnston,
The spec clearly states that
/sync
should return events according to the "arrival time of the event on the homeserver" (stream_ordering
). This is not how Synapse has been behaving since the beginning. element-hq/synapse@e2accd7 even claims the following in the commit message:Normally, this would just be a spec-compliance problem in Synapse but I think this may be the right way to think about it.
Proposal
For initial
/sync
, we want to view a historical section of the timeline; to fetch events bytopological_ordering
(partial ordering in the event graph) (best representation of the room DAG as others were seeing it at the time). This also aligns with the order that/messages
returns events in. We should also extend this to any time we're initially returning a room (therefore historical events) to the user (like a newly joined room). This behavior basically results in the same outcome as if no history was sent down/sync
and/messages
was used instead.For incremental
/sync
, we want to get all updates for rooms since the last/sync
(regardless if those updates arrived late or happened a while ago in the past); to fetch events bystream_ordering
(in the order they were received by the server).Related issues
stream ordering
andtopological ordering
#1334/messages
to use stream ordering for events #852The text was updated successfully, but these errors were encountered: