bug: when "m.room.guest_access", "m.room.history_visibility", "m.room.join_rules" are inserted into "initial_state" when requesting createRoom are treated as additives instead of taking precedence thus producing useless events #2575

Open
opened 2026-11-21 20:57:32 +00:00 by gan · 0 comments

What is the bug?

As the spec suggests, this is unexpected behavior, the aforementioned events should supplant whatever the default is supposed to be added on room creation.

Steps to reproduce

  1. Create a room using createRoom endpoint, for example with:
{
  [...]
  "initial_state": [
    {
      "type": "m.room.encryption",
      "state_key": "",
      "content": {
        "algorithm": "m.megolm.v1.aes-sha2"
      }
    },
    {
      "type": "m.room.guest_access",
      "state_key": "",
      "content": {
        "guest_access": "forbidden"
      }
    },
    {
      "type": "m.room.history_visibility",
      "state_key": "",
      "content": {
        "history_visibility": "joined"
      }
    },
    {
      "type": "m.room.join_rules",
      "state_key": "",
      "content": {
        "join_rule": "knock"
      }
    }[...]
  ]
}
  1. Observe the events from the defaults and the events provided by the client's request being added.

Server name and version

continuwuity 26.9.4 (dda4bdc)

Additional context

No response

### What is the bug? As the [spec suggests](https://spec.matrix.org/v1.19/client-server-api/#post_matrixclientv3createroom:~:text=Takes%20precedence%20over%20events%20set%20by%20preset%2C%20but%20gets%20overridden%20by%20name%20and%20topic%20keys), this is unexpected behavior, the aforementioned events should supplant whatever the default is supposed to be added on room creation. ### Steps to reproduce 1. Create a room using `createRoom` endpoint, for example with: ```json { [...] "initial_state": [ { "type": "m.room.encryption", "state_key": "", "content": { "algorithm": "m.megolm.v1.aes-sha2" } }, { "type": "m.room.guest_access", "state_key": "", "content": { "guest_access": "forbidden" } }, { "type": "m.room.history_visibility", "state_key": "", "content": { "history_visibility": "joined" } }, { "type": "m.room.join_rules", "state_key": "", "content": { "join_rule": "knock" } }[...] ] } ``` 2. Observe the events from the defaults and the events provided by the client's request being added. ### Server name and version continuwuity 26.9.4 (dda4bdc) ### Additional context _No response_
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2575
No description provided.