matrix-org / matrix-org/matrix-spec
Setting power levels during room creation
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
This is a mix of clarification and suggestion but since the two issues correlate I thought it'd be better to create a single issue.
**Link to problem area**:
https://spec.matrix.org/v1.11/client-server-api/#post_matrixclientv3createroom

**Issue**
The `/createRoom` API provides clients with two options to set the `m.room.power_levels` event.
`power_level_content_override` is merged into the default power-level event and inserted as the first event after `m.room.create` and the room creator's `m.room.member` event.
Events in `initial_state` are inserted towards the end of room creation but before `m.room.name`, `m.room.topic` and any invites.
There are two issues here:
1. Synapse doesn't follow this and instead inserts the power-level event from `initial_state` in the place where `power_level_content_override` should be applied, ignoring the former. According to https://github.com/matrix-org/synapse/issues/11731#issuecomment-1012304503 [^1] this is deemed the preferred behavior.
2. Regardless of whether the order from the spec or from Synapse is used, it's not possible for a room creator to fully demote themselves at the end of room creation through `/createRoom`. With the spec'ed behavior, further state events are sent after `initial_state` which prevents taking away power levels for these events via `initial_state`. With Synapse's behavior, power levels can only be applied at the beginning of room creation which disables most if not all practical demotion options. While it's possible to demote yourself by sending another request after room creation, this makes the `initial_state` parameter less useful than it could be.
**Suggestion**
1. The discrepancy between Synapse and the spec should be resolved.
2. `initial_state` (or something similar) should be applied in step 8 rather than 6
[^1]: Note that this issue continues at https://github.com/element-hq/synapse/issues/11731
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Matrix Client-Server API /createRoom section and compare its event ordering with Synapse issue #11731. Clarify the intended ordering and how power levels can fully demote the creator; done means the specification and Synapse behavior are reconciled and the /createRoom guidance is updated.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100