diff --git a/content/client-server-api/modules/spaces.md b/content/client-server-api/modules/spaces.md index c95ae01d199..6d8abce529d 100644 --- a/content/client-server-api/modules/spaces.md +++ b/content/client-server-api/modules/spaces.md @@ -114,8 +114,9 @@ lexicographically by Unicode code-points such that `\x20` (space) is sorted befo of their `m.space.child` event in ascending numeric order, placing them after the children with a valid `order` key in the resulting set. -In cases where the `order` or timestamps are the same, the children are ordered -lexicographically by their room IDs (state keys) in ascending order. +In cases where the `order` values are the same, the children are ordered by their +timestamps. If the timestamps are the same, the children are ordered lexicographically +by their room IDs (state keys) in ascending order. Noting the careful use of ASCII spaces here, the following demonstrates a set of space children being ordered appropriately: @@ -249,6 +250,6 @@ additionally contain information about rooms the requesting user is already a me of, or that the server is aware of - the local data should be used instead of the remote server's data. -Note that the response to this endpoint is contextual based on the user. Servers are +Note that the response to the client endpoint is contextual based on the user. Servers are encouraged to cache the data for a period of time, though permission checks may need to be performed to ensure the response is accurate for that user. diff --git a/data/api/server-server/space_hierarchy.yaml b/data/api/server-server/space_hierarchy.yaml index 99b86577e3a..3d8641eb0f9 100644 --- a/data/api/server-server/space_hierarchy.yaml +++ b/data/api/server-server/space_hierarchy.yaml @@ -141,7 +141,7 @@ paths: type: string description: |- If the room is a [restricted room](#restricted-rooms), these are the room IDs which - are specified by the join rules. Empty otherwise. + are specified by the join rules. Empty or omitted otherwise. children_state: type: array description: |- @@ -179,33 +179,15 @@ paths: type: string description: |- If the room is a [restricted room](#restricted-rooms), these are the room IDs which - are specified by the join rules. Empty otherwise. - children_state: - type: array - description: |- - The [`m.space.child`](/client-server-api/#mspacechild) events of the space-room, represented - as [Stripped State Events](/client-server-api/#stripped-state) with an added - `origin_server_ts` key. - - If the room is not a space-room, this should be empty. - items: - allOf: - - $ref: "../../event-schemas/schema/core-event-schema/stripped_state.yaml" - - type: object - properties: - origin_server_ts: - type: number - format: int64 - description: The `origin_server_ts` for the event. - required: [origin_server_ts] + are specified by the join rules. Empty or omitted otherwise. required: [room_type, allowed_room_ids, children_state] inaccessible_children: type: array items: type: string description: |- - The list of room IDs the responding server cannot provide details on. Rooms which the requesting - server doesn't have a viable way to peek/join will be outright excluded from the response instead. + The list of room IDs the requesting server doesn't have a viable way to peek/join. Rooms which + the responding server cannot provide details on will be outright excluded from the response instead. Assuming both the requesting and responding server are well behaved, the requesting server should consider these room IDs as not accessible from anywhere. They should not be re-requested. diff --git a/data/event-schemas/schema/m.space.child.yaml b/data/event-schemas/schema/m.space.child.yaml index da0216048d9..afdfefa9bd7 100644 --- a/data/event-schemas/schema/m.space.child.yaml +++ b/data/event-schemas/schema/m.space.child.yaml @@ -27,8 +27,7 @@ properties: `order` values with the wrong type, or otherwise invalid contents, are to be treated as though the `order` key was not provided. - Children without an `order` are sorted after children with an `order`, ordered by the - timestamp of their `m.room.create` event in ascending numeric order. + See [Ordering](/client-server-api/#ordering-1) for information on how the ordering works. suggested: type: boolean description: |- diff --git a/proposals/1772-groups-as-rooms.md b/proposals/1772-groups-as-rooms.md index 6c6db0bf1dc..8cc5933f846 100644 --- a/proposals/1772-groups-as-rooms.md +++ b/proposals/1772-groups-as-rooms.md @@ -122,8 +122,9 @@ relationship can be expressed in one of two ways: The `order` key is a string which is used to provide a default ordering of siblings in the room list. (Rooms are sorted based on a lexicographic ordering of the Unicode codepoints of the characters in `order` values. - Rooms with no `order` come last, in ascending numeric order of the - `origin_server_ts` of their `m.room.create` events, or ascending + Rooms with no `order` come last with no effective `order`. When the `order` + (or lack thereof) is the same, the rooms are sorted in ascending numeric + order of the `origin_server_ts` of their `m.room.create` events, or ascending lexicographic order of their `room_id`s in case of equal `origin_server_ts`. `order`s which are not strings, or do not consist solely of ascii characters in the range `\x20` (space) to `\x7E` (`~`), or diff --git a/proposals/2946-spaces-summary.md b/proposals/2946-spaces-summary.md index f2e28ab1e39..a73b7d775f6 100644 --- a/proposals/2946-spaces-summary.md +++ b/proposals/2946-spaces-summary.md @@ -254,7 +254,9 @@ with the addition of: event, if any. * **`allowed_room_ids`**: A list of room IDs which give access to this room per [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083).[1](#f1) -* **`children_state`**: As per Client-Server API version. + Optional if would be empty. +* **`children_state`**: As per Client-Server API version, though only on the `room` + and not `children`. #### Example request: @@ -275,13 +277,14 @@ requesting server is not allowed to access the room. of "default ordering of siblings in the room list" using the `order` key: > Rooms are sorted based on a lexicographic ordering of the Unicode codepoints -> of the characters in `order` values. Rooms with no `order` come last, in -> ascending numeric order of the `origin_server_ts` of their `m.room.create` -> events, or ascending lexicographic order of their `room_id`s in case of equal -> `origin_server_ts`. `order`s which are not strings, or do not consist solely -> of ascii characters in the range `\x20` (space) to `\x7E` (~), or consist of -> more than 50 characters, are forbidden and the field should be ignored if -> received. +> of the characters in `order` values. Rooms with no `order` come last with no +> effective `order`. When the `order` (or lack thereof) is the same, the rooms +> are sorted in ascending numeric order of the `origin_server_ts` of their +> `m.room.create` events, or ascending lexicographic order of their `room_id`s +> in case of equal `origin_server_ts`. `order`s which are not strings, or do +> not consist solely of ascii characters in the range `\x20` (space) to `\x7E` +> (`~`), or consist of more than 50 characters, are forbidden and the field +> should be ignored if received. Unfortunately there are situations when a homeserver comes across a reference to a child room that is unknown to it and must decide the ordering. Without being @@ -312,16 +315,8 @@ request a space summary for Room D, but this is undesirable: * If we expand the example above to many rooms than this becomes expensive to query a remote server simply for ordering. -This proposes changing the ordering rules from MSC1772 to the following: - -> Rooms are sorted based on a lexicographic ordering of the Unicode codepoints -> of the characters in `order` values. Rooms with no `order` come last, in -> ascending numeric order of the `origin_server_ts` of their `m.space.child` -> events, or ascending lexicographic order of their `room_id`s in case of equal -> `origin_server_ts`. `order`s which are not strings, or do not consist solely -> of ascii characters in the range `\x20` (space) to `\x7E` (~), or consist of -> more than 50 characters, are forbidden and the field should be ignored if -> received. +This proposes changing the ordering rules from MSC1772 to consider the `m.space.child` +event instead of the `m.room.create` event. This modifies the clause for calculating the order to use the `origin_server_ts` of the `m.space.child` event instead of the `m.room.create` event. This allows