Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add room version 11 #1604

Merged
merged 20 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/room_versions/newsfragments/1604.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add room version 11 as per [MSC3820](https://github.com/matrix-org/matrix-spec-proposals/pull/3820).
14 changes: 7 additions & 7 deletions content/rooms/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Alternatively, consider flipping the column/row organization to be features
up top and versions on the left.
-->

| Feature \ Version | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|-------------------|---|---|---|---|---|---|---|---|---|----|
| **Knocking** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ |
| **Restricted join rules** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ |
| **`knock_restricted` join rule** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ |
| Feature \ Version | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|-------------------|---|---|---|---|---|---|---|---|---|----|----|
| **Knocking** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ | ✔ |
| **Restricted join rules** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ | ✔ | ✔ |
| **`knock_restricted` join rule** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✔ | ✔ |

## Complete list of room versions

Expand All @@ -57,8 +57,7 @@ the default room version when creating new rooms.

The available room versions are:

- [Version 1](/rooms/v1) - **Stable**. The current version of most
rooms.
- [Version 1](/rooms/v1) - **Stable**. The initial room version.
- [Version 2](/rooms/v2) - **Stable**. Implements State Resolution
Version 2.
- [Version 3](/rooms/v3) - **Stable**. Introduces events whose IDs
Expand All @@ -76,6 +75,7 @@ The available room versions are:
redacting some membership events.
- [Version 10](/rooms/v10) - **Stable**. Enforces integer-only power levels
and adds `knock_restricted` join rule.
- [Version 11](/rooms/v11) - **Stable**. Clarifies the redaction algorithm.

## Room version grammar

Expand Down
18 changes: 10 additions & 8 deletions content/rooms/fragments/v1-redactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ not in the following list:
- `membership`

The content object must also be stripped of all keys, unless it is one
of one of the following event types:
of the following event types:

- `m.room.member` allows key `membership`.
- `m.room.create` allows key `creator`.
- `m.room.join_rules` allows key `join_rule`.
- `m.room.power_levels` allows keys `ban`, `events`, `events_default`,
`kick`, `redact`, `state_default`, `users`, `users_default`.
- `m.room.aliases` allows key `aliases`.
- `m.room.history_visibility` allows key `history_visibility`.
- [`m.room.member`](/client-server-api#mroommember) allows key `membership`.
- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`.
- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows key `join_rule`.
- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys
`ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`,
`users_default`.
- [`m.room.aliases`](/client-server-api#historical-events) allows key `aliases`.
- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) allows
key `history_visibility`.
4 changes: 4 additions & 0 deletions content/rooms/fragments/v11-event-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

Events in rooms of this version have the following structure:

{{% definition path="api/server-server/definitions/pdu_v11" %}}
30 changes: 30 additions & 0 deletions content/rooms/fragments/v11-redactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

Upon receipt of a redaction event, the server must strip off any keys
not in the following list:

- `event_id`
- `type`
- `room_id`
- `sender`
- `state_key`
- `content`
- `hashes`
- `signatures`
- `depth`
- `prev_events`
- `auth_events`
- `origin_server_ts`

The content object must also be stripped of all keys, unless it is one
of the following event types:

- [`m.room.member`](/client-server-api#mroommember) allows keys `membership`, `join_authorised_via_users_server`.
Additionally, it allows the `signed` key of the `third_party_invite` key.
- [`m.room.create`](/client-server-api#mroomcreate) allows all keys.
- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows keys `join_rule`, `allow`.
- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys
`ban`, `events`, `events_default`, `invite`, `kick`, `redact`, `state_default`,
`users`, `users_default`.
- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility)
allows key `history_visibility`.
- [`m.room.redaction`](/client-server-api#mroomredaction) allows key `redacts`.
16 changes: 9 additions & 7 deletions content/rooms/fragments/v6-redactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ not in the following list:
- `membership`

The content object must also be stripped of all keys, unless it is one
of one of the following event types:
of the following event types:

- `m.room.member` allows key `membership`.
- `m.room.create` allows key `creator`.
- `m.room.join_rules` allows key `join_rule`.
- `m.room.power_levels` allows keys `ban`, `events`, `events_default`,
`kick`, `redact`, `state_default`, `users`, `users_default`.
- `m.room.history_visibility` allows key `history_visibility`.
- [`m.room.member`](/client-server-api#mroommember) allows key `membership`.
- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`.
- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows key `join_rule`.
- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys
`ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`,
`users_default`.
- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility) allows
key `history_visibility`.
41 changes: 12 additions & 29 deletions content/rooms/fragments/v9-redactions.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
---
---

{{% added-in this=true %}} `m.room.member` events now keep `join_authorised_via_users_server`
in addition to other keys in `content` when being redacted.

{{% boxes/rationale %}}
Without the `join_authorised_via_users_server` property, redacted join events
can become invalid when verifying the auth chain of a given event, thus creating
a split-brain scenario where the user is able to speak from one server's
perspective but most others will continually reject their events.

This can theoretically be worked around with a rejoin to the room, being careful
not to use the faulty events as `prev_events`, though instead it is encouraged
to use v9 rooms over v8 rooms to outright avoid the situation.

[Issue #3373](https://github.com/matrix-org/matrix-doc/issues/3373) has further
information.
{{% /boxes/rationale %}}

The full redaction algorithm follows.

Upon receipt of a redaction event, the server must strip off any keys
not in the following list:
Expand All @@ -40,11 +19,15 @@ not in the following list:
- `membership`

The content object must also be stripped of all keys, unless it is one
of one of the following event types:

- `m.room.member` allows keys `membership`, `join_authorised_via_users_server`.
- `m.room.create` allows key `creator`.
- `m.room.join_rules` allows keys `join_rule`, `allow`.
- `m.room.power_levels` allows keys `ban`, `events`, `events_default`,
`kick`, `redact`, `state_default`, `users`, `users_default`.
- `m.room.history_visibility` allows key `history_visibility`.
of the following event types:

- [`m.room.member`](/client-server-api#mroommember) allows keys `membership`,
`join_authorised_via_users_server`.
- [`m.room.create`](/client-server-api#mroomcreate) allows key `creator`.
- [`m.room.join_rules`](/client-server-api#mroomjoin_rules) allows keys `join_rule`,
`allow`.
- [`m.room.power_levels`](/client-server-api#mroompower_levels) allows keys
`ban`, `events`, `events_default`, `kick`, `redact`, `state_default`, `users`,
`users_default`.
- [`m.room.history_visibility`](/client-server-api#mroomhistory_visibility)
allows key `history_visibility`.
Loading
Loading