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

MSC3214: Allow overriding m.room.power_levels using initial_state #3214

Open
wants to merge 1 commit into
base: old_master
Choose a base branch
from

Conversation

tulir
Copy link
Member

@tulir tulir commented May 24, 2021

Signed-off-by: Tulir Asokan <tulir@maunium.net>
@uhoreg uhoreg added kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal proposal-in-review labels May 24, 2021
@turt2live turt2live self-requested a review June 8, 2021 15:10
Comment on lines +36 to +38
`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.
Copy link
Member

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.

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?

Copy link
Contributor

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.

Comment on lines +8 to +12
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.
Copy link
Member

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.

Copy link
Contributor

@deepbluev7 deepbluev7 Apr 3, 2022

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)

Copy link
Contributor

@Johennes Johennes Jul 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:maintenance MSC which clarifies/updates existing spec proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants