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

Setting power levels during room creation #1901

Open
Johennes opened this issue Jul 5, 2024 · 2 comments
Open

Setting power levels during room creation #1901

Johennes opened this issue Jul 5, 2024 · 2 comments
Labels
clarification An area where the expected behaviour is understood, but the spec could do with being more explicit

Comments

@Johennes
Copy link
Contributor

Johennes commented Jul 5, 2024

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

Screenshot 2024-07-05 at 11 38 57

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 Synapse does not respect event order of spec /createRoom synapse#11731 (comment) 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

Footnotes

  1. Note that this issue continues at https://github.com/element-hq/synapse/issues/11731

@Johennes Johennes added the clarification An area where the expected behaviour is understood, but the spec could do with being more explicit label Jul 5, 2024
@richvdh
Copy link
Member

richvdh commented Jul 5, 2024

@Johennes I think some words are missing from the issue title?

@Johennes Johennes changed the title Setting power levels during Setting power levels during room creation Jul 5, 2024
@Johennes
Copy link
Contributor Author

Johennes commented Jul 5, 2024

Errm, yes sorry. Somehow I cut myself off there. Thanks for flagging. I fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the expected behaviour is understood, but the spec could do with being more explicit
Projects
None yet
Development

No branches or pull requests

2 participants