-
Notifications
You must be signed in to change notification settings - Fork 377
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
MSC3214: Allow overriding m.room.power_levels
using initial_state
#3214
base: old_master
Are you sure you want to change the base?
Conversation
Signed-off-by: Tulir Asokan <tulir@maunium.net>
`power_level_content_override` can technically be used to undo everything in | ||
the default power levels, but it's more convenient and intuitive if | ||
`initial_state` can be used to simply replace the first power level event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having troubles seeing why this isn't acceptable for an approach: changing the semantics of initial_state
for one event type feels overly wrong, and power_level_content_override
is perfectly able to accept a complete content
.
Is the primary concern code cleanliness?
levels. The spec defines a `power_level_content_override` field that is applied | ||
on top of the default power levels for this purpose. However, that field can't | ||
easily replace the entire default content, as it gets merged with the default | ||
levels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think power_level_content_override should be deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this MSC complicates the situation of initial_state vs override a bit, as override overrides certain bits of the to-be-created state event, while initial_state would replace the entire powerlevels event.
This would create different results on different room versions, if the default powerlevels would ever be changed.
Synapse already allows replacing the entire power level event content by | ||
placing a power level event in `initial_state`. However, interpreting the spec | ||
literally means inserting the default power level event first, then inserting | ||
the one from `initial_state`, which might not be possible due to auth rules | ||
anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, the algorithm seems to have been specced in 2016 by #362. Synapse's implementation was changed in 2017 by matrix-org/synapse#2291, but that did not get transferred to the spec.
Server implementations will have to separately check for `m.room.power_levels` | ||
events in the `initial_state` list, which is slightly more effort than the | ||
current flow. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks some approaches of sending PLs. While those currently also don't work on synapse, they should and imo it is a bug.
I.e. imagine you want to demote yourself after creating the room. Currently you should be able to send an override, where you are PL100, add events to initial_state, that require PL100 to send and then as the last event in initial_state you send a PL event that demotes you. While that is a niche usecase, it occasionally comes up and it is currently impossible to do without doing 2 separate requests. Otoh, the only thing this MSC achieves is make the power level overrides unnecessary, but it doesn't enable any usecases that couldn't be done by just putting the PL content into the override instead.
See also: matrix-org/synapse#11731 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In lack of a better place to discuss the demotion use case: Even if Synapse did comply with the current spec, I think fully supporting this would require sending the events from initial_state
in the very last step, right? With the current ordering in the spec, name, topic and invites are all sent after initial_state
.
Update: Sorry, probably not the best place to discuss this. I have opened matrix-org/matrix-spec#1901 instead.
Rendered
Synapse implementation
Dendrite implementation
mautrix-signal implementation