Compare commits

...

3 commits

Author SHA1 Message Date
Tom Foster 348e292ae0
Merge 433f0361e1 into 9c313b099f 2025-08-06 16:12:38 -04:00
Kévin Commaille 9c313b099f
Add state_after to /sync (#2187)
Some checks are pending
Spec / 🔎 Validate OpenAPI specifications (push) Waiting to run
Spec / 🔎 Check Event schema examples (push) Waiting to run
Spec / 🔎 Check OpenAPI definitions examples (push) Waiting to run
Spec / 🔎 Check JSON Schemas inline examples (push) Waiting to run
Spec / ⚙️ Calculate baseURL for later jobs (push) Waiting to run
Spec / 🐍 Build OpenAPI definitions (push) Blocked by required conditions
Spec / 📢 Run towncrier for changelog (push) Waiting to run
Spec / 📖 Build the spec (push) Blocked by required conditions
Spec / 🔎 Validate generated HTML (push) Blocked by required conditions
Spec / 📖 Build the historical backup spec (push) Blocked by required conditions
Spell Check / Spell Check with Typos (push) Waiting to run
* Add `state_after` to `/sync`

As per MSC4222.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Improve wording

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Clarify to not use timeline with state_after

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-06 15:49:32 -04:00
Richard van der Hoff 67a2aa4761
Specify a correct spelling for "display name" (#2189)
Some checks are pending
Spec / 🔎 Validate OpenAPI specifications (push) Waiting to run
Spec / 🔎 Check Event schema examples (push) Waiting to run
Spec / 🔎 Check OpenAPI definitions examples (push) Waiting to run
Spec / 🔎 Check JSON Schemas inline examples (push) Waiting to run
Spec / ⚙️ Calculate baseURL for later jobs (push) Waiting to run
Spec / 🐍 Build OpenAPI definitions (push) Blocked by required conditions
Spec / 📢 Run towncrier for changelog (push) Waiting to run
Spec / 📖 Build the spec (push) Blocked by required conditions
Spec / 🔎 Validate generated HTML (push) Blocked by required conditions
Spec / 📖 Build the historical backup spec (push) Blocked by required conditions
Spell Check / Spell Check with Typos (push) Waiting to run
* Specify a correct spelling for "display name"

* RST uses double-backticks
2025-08-06 07:21:58 +01:00
4 changed files with 95 additions and 8 deletions

View file

@ -0,0 +1 @@
Add the `use_state_after` query parameter and `state_after` response property to `GET /sync`, as per [MSC4222](https://github.com/matrix-org/matrix-spec-proposals/issues/4222).

View file

@ -0,0 +1 @@
Specify a correct spelling for "display name".

View file

@ -117,6 +117,31 @@ paths:
example: 30000
schema:
type: integer
- in: query
name: use_state_after
x-addedInMatrixVersion: "1.16"
description: |-
Controls whether to receive state changes between the previous sync
and the **start** of the timeline, or between the previous sync and
the **end** of the timeline.
If this is set to `true`, servers MUST respond with the state
between the previous sync and the **end** of the timeline in
`state_after` and MUST omit `state`.
If `false`, servers MUST respond with the state between the previous
sync and the **start** of the timeline in `state` and MUST omit
`state_after`.
Even if this is set to `true`, clients MUST update their local state
with events in `state` and `timeline` if `state_after` is missing in
the response, for compatibility with servers that don't support this
parameter.
By default, this is `false`.
example: false
schema:
type: boolean
responses:
"200":
description: The initial snapshot or delta for the client to use to update their
@ -197,16 +222,50 @@ paths:
type: object
description: |-
Updates to the state, between the time indicated by
the `since` parameter, and the start of the
`timeline` (or all state up to the start of the
the `since` parameter, and the **start** of the
`timeline` (or all state up to the **start** of the
`timeline`, if `since` is not given, or
`full_state` is true).
N.B. state updates for `m.room.member` events will
{{% boxes/note %}}
State updates for `m.room.member` events will
be incomplete if `lazy_load_members` is enabled in
the `/sync` filter, and only return the member events
required to display the senders of the timeline events
in this response.
{{% /boxes/note %}}
MUST be omitted if `use_state_after` was set to `true`
in the request.
allOf:
- $ref: definitions/state_event_batch.yaml
state_after:
title: State
type: object
x-addedInMatrixVersion: "1.16"
description: |-
Updates to the state, between the time indicated by
the `since` parameter, and the **end** of the
`timeline` (or all state up to the **end** of the
`timeline`, if `since` is not given, or
`full_state` is true).
{{% boxes/note %}}
State updates for `m.room.member` events will
be incomplete if `lazy_load_members` is enabled in
the `/sync` filter, and only return the member events
required to display the senders of the timeline events
in this response.
{{% /boxes/note %}}
If this field is set, even if it is empty, clients MUST
only update their local state with events in this list,
and MUST NOT update their local state with events in
`timeline`. If this field is not set, clients MUST update
their local state with events in `state` and `timeline`.
**Required** if `use_state_after` was set to `true` in the
request, even if it is empty.
allOf:
- $ref: definitions/state_event_batch.yaml
timeline:
@ -353,7 +412,28 @@ paths:
state:
title: State
type: object
description: The state updates for the room up to the start of the timeline.
description: |-
The state updates for the room up to the **start** of the timeline.
MUST be omitted if `use_state_after` was set to `true` in the
request.
allOf:
- $ref: definitions/state_event_batch.yaml
state_after:
title: State
type: object
x-addedInMatrixVersion: "1.16"
description: |-
The state updates for the room up to the **end** of the timeline.
If this field is set, even if it is empty, clients MUST only
update their local state with events in this list, and MUST NOT
update their local state with events in `timeline`. If this field
is not set, clients MUST update their local state with events in
`state` and `timeline`.
**Required** if `use_state_after` was set to `true` in the
request, even if it is empty.
allOf:
- $ref: definitions/state_event_batch.yaml
timeline:

View file

@ -60,6 +60,11 @@ General
you have at home. "identity server" is clear, whereas "identityserver" is
horrible.
* When talking about a user's "display name", it is spelt as two words. In
identifiers such as within the content of an ``m.room.member`` event, it is
spelt as a single word, ``displayname``. (There are some historical exceptions
to this where the identifier is spelt ``display_name``.)
* Lists should:
* Be introduced with a colon.
@ -84,12 +89,12 @@ Changes between spec versions
Sections should reference the Matrix spec version they were added/changed in. This
is often a guess at what the next version will be - please use the currently released
version with a minor version bump as the referenced version. For example, if the
current version is `v1.1` then annotate your changes with `v1.2`.
current version is ``v1.1`` then annotate your changes with ``v1.2``.
"Added/changed in" tags can be documented as the following:
* `{{% added-in v="1.2" %}}` or `{{% changed-in v="1.2" %}}` within Markdown documents.
* `x-addedInMatrixVersion` and `x-changedInMatrixVersion` within OpenAPI.
* ``{{% added-in v="1.2" %}}`` or ``{{% changed-in v="1.2" %}}`` within Markdown documents.
* ``x-addedInMatrixVersion`` and ``x-changedInMatrixVersion`` within OpenAPI.
OpenAPI
~~~~~~~
@ -185,4 +190,4 @@ Describing grammar
Use `RFC5234-style ABNF <https://datatracker.ietf.org/doc/html/rfc5234>`_ when describing
the grammar for something in the spec, such as user IDs or server names. Use lowercase
and underscore-delimited element names (`user_id`, not `UserID` or `user-id`).
and underscore-delimited element names (``user_id``, not ``UserID`` or ``user-id``).