Skip to content

Commit

Permalink
Accuracy per review
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jan 5, 2022
1 parent e68dc2f commit 6616a5e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 47 deletions.
7 changes: 4 additions & 3 deletions content/client-server-api/modules/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
26 changes: 4 additions & 22 deletions data/api/server-server/space_hierarchy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions data/event-schemas/schema/m.space.child.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |-
Expand Down
5 changes: 3 additions & 2 deletions proposals/1772-groups-as-rooms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 13 additions & 18 deletions proposals/2946-spaces-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).<sup id="a1">[1](#f1)</sup>
* **`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:

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6616a5e

Please sign in to comment.