Better msc4311_stripped_state description

This commit is contained in:
Eric Eastwood
2026-05-26 15:17:36 -05:00
parent 1926534029
commit 17c376348d
2 changed files with 18 additions and 22 deletions
+9 -11
View File
@@ -161,24 +161,22 @@ pub struct RoomVersion {
/// This is similar to how doubly-linked lists can potentially not refer to previous items correctly
/// without verifying the list's integrity, but doing it on every insert is too expensive.
pub msc4242_state_dags: bool,
/// Whether the `m.room.create` event is required in
/// `invite_room_state`/`knock_room_state` when receiving invites/knocks over the
/// federation API's.
///
/// Also determines whether we expect full PDU's in the
/// `invite_room_state`/`knock_room_state` in the federation API. The client API
/// still uses stripped state.
/// Determines whether a room version *SHOULD* rather than *MAY* reject invites/knocks
/// with invalid stripped state events.
///
/// According to MSC4311:
/// > If any of the events are not a PDU, not for the room ID specified, or fail
/// > If any of the [stripped state] events are not a PDU, not for the room ID specified, or fail
/// > signature checks, or the `m.room.create` event is missing, the receiving
/// > server MAY respond to invites with a `400 M_MISSING_PARAM` standard Matrix
/// > error (new to the endpoint). For invites to room version 12+ rooms, servers
/// > SHOULD rather than MAY respond to such requests with `400 M_MISSING_PARAM`.
///
/// This does *not* determine whether we should include the `m.room.create` event in
/// stripped state or use full PDU's in stripped state over federation. We should
/// always do this.
/// Regardless of room version (we should always do these things):
/// 1. The `m.room.create` event *MUST* be included in
/// `invite_room_state`/`knock_room_state` when sending invites/knocks over the
/// federation API's.
/// 2. Use full PDU's in the `invite_room_state`/`knock_room_state` in the federation
/// API. The client API still uses stripped state.
msc4311_stripped_state: bool,
}
+9 -11
View File
@@ -125,24 +125,22 @@ class RoomVersion:
without verifying the list's integrity, but doing it on every insert is too expensive."""
msc4311_stripped_state: bool
"""
Whether the `m.room.create` event is required in
`invite_room_state`/`knock_room_state` when receiving invites/knocks over the
federation API's.
Also determines whether we expect full PDU's in the
`invite_room_state`/`knock_room_state` in the federation API. The client API
still uses stripped state.
Determines whether a room version *SHOULD* rather than *MAY* reject invites/knocks
with invalid stripped state events.
According to MSC4311:
> If any of the events are not a PDU, not for the room ID specified, or fail
> If any of the [stripped state] events are not a PDU, not for the room ID specified, or fail
> signature checks, or the `m.room.create` event is missing, the receiving
> server MAY respond to invites with a `400 M_MISSING_PARAM` standard Matrix
> error (new to the endpoint). For invites to room version 12+ rooms, servers
> SHOULD rather than MAY respond to such requests with `400 M_MISSING_PARAM`.
This does *not* determine whether we should include the `m.room.create` event in
stripped state or use full PDU's in stripped state over federation. We should
always do this.
Regardless of room version (we should always do these things):
1. The `m.room.create` event *MUST* be included in
`invite_room_state`/`knock_room_state` when sending invites/knocks over the
federation API's.
2. Use full PDU's in the `invite_room_state`/`knock_room_state` in the federation
API. The client API still uses stripped state.
"""
class RoomVersions: