From 22f4f2004fa140b66dee2216d82dbe646d546c60 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 4 May 2026 18:24:39 -0500 Subject: [PATCH] Updated comment --- rust/src/room_versions.rs | 12 ++++++++---- synapse/synapse_rust/room_versions.pyi | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/rust/src/room_versions.rs b/rust/src/room_versions.rs index 2dc7350194..7728f02c23 100644 --- a/rust/src/room_versions.rs +++ b/rust/src/room_versions.rs @@ -157,11 +157,11 @@ 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 the - /// `invite_state`/`knock_state` and `invite_room_state`/`knock_room_state` in the - /// client and federation API's. + /// 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 full PDU's are returned in the + /// 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. /// @@ -171,6 +171,10 @@ pub struct RoomVersion { /// > 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. pub msc4311_stripped_state: bool, } diff --git a/synapse/synapse_rust/room_versions.pyi b/synapse/synapse_rust/room_versions.pyi index 593b8a1d34..0bd56ebda9 100644 --- a/synapse/synapse_rust/room_versions.pyi +++ b/synapse/synapse_rust/room_versions.pyi @@ -125,13 +125,24 @@ 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 the - `invite_state`/`knock_state` and `invite_room_state`/`knock_room_state` in the - client and federation API's. - /// - Also determines whether full PDU's are returned in the + 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. + + According to MSC4311: + > If any of the 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. """ class RoomVersions: