mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-29 05:44:10 +02:00
Compare commits
4 commits
949cd8c3f8
...
5fc3100811
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fc3100811 | ||
|
|
9c313b099f | ||
|
|
3c17aa3789 | ||
|
|
506bc1a164 |
|
|
@ -0,0 +1,2 @@
|
|||
Clarify that the stripped state in `invite_state` and `knock_state` in `GET /sync` response must
|
||||
include the full `m.room.member` event of the user.
|
||||
1
changelogs/client_server/newsfragments/2187.feature
Normal file
1
changelogs/client_server/newsfragments/2187.feature
Normal 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).
|
||||
|
|
@ -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:
|
||||
|
|
@ -310,8 +369,14 @@ paths:
|
|||
description: |-
|
||||
The [stripped state events](/client-server-api/#stripped-state) that form the
|
||||
invite state.
|
||||
|
||||
MUST also include the `m.room.member` event of the user with a membership of
|
||||
`invite`, and using the same event format as joined rooms with the `event_id`
|
||||
and `origin_server_ts` fields.
|
||||
items:
|
||||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
||||
anyOf:
|
||||
- $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
||||
- $ref: definitions/client_event_without_room_id.yaml
|
||||
type: array
|
||||
knock:
|
||||
title: Knocked rooms
|
||||
|
|
@ -335,8 +400,14 @@ paths:
|
|||
description: |-
|
||||
The [stripped state events](/client-server-api/#stripped-state) that form the
|
||||
knock state.
|
||||
|
||||
MUST also include the `m.room.member` event of the user with a membership of
|
||||
`knock`, and using the same event format as joined rooms with the `event_id` and
|
||||
`origin_server_ts` fields.
|
||||
items:
|
||||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
||||
anyOf:
|
||||
- $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml
|
||||
- $ref: definitions/client_event_without_room_id.yaml
|
||||
type: array
|
||||
leave:
|
||||
title: Left rooms
|
||||
|
|
@ -353,7 +424,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:
|
||||
|
|
@ -548,6 +640,8 @@ paths:
|
|||
"sender": "@alice:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@bob:example.com",
|
||||
"event_id": "$19dl9d3848dJLle:example.com",
|
||||
"origin_server_ts": 1432735439654,
|
||||
"content": {
|
||||
"membership": "invite"
|
||||
}
|
||||
|
|
@ -572,6 +666,8 @@ paths:
|
|||
"sender": "@bob:example.com",
|
||||
"type": "m.room.member",
|
||||
"state_key": "@bob:example.com",
|
||||
"event_id": "$Fg83Kl3764di23a:example.com",
|
||||
"origin_server_ts": 143273039402,
|
||||
"content": {
|
||||
"membership": "knock"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue