-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Unclear override semantics for power_level_content_override
#492
Comments
I found this issue while trying to understand the same, docs are not very helpful. Would appreciate a clarification here 🙂 Seems the root powers are kept, but the events are overridden completely. |
Reading the Synapse code, what Synapse does is examine So if I provide: {
"power_level_content_override": {
"events": {
"my.event.type": 0
}
}
} Then the room's power levels will be the defaults, except that {
"ban": 50,
"events": {
"my.event.type": 0,
},
"events_default": 0,
"historical": 100,
"invite": 50,
"kick": 50,
"redact": 50,
"state_default": 50,
"users": {"@sid1:red": 100},
"users_default": 0
} |
I just ran into this confusion when writing a Complement test. I assumed it would deep-merge, and so the test assumes that. It appears that Dendrite's implementation deep merges (and hence my test that assumes deep-merge passes on it). See the implementation in Dendrite here: https://github.com/matrix-org/dendrite/blob/main/clientapi/routing/createroom.go#L242-L252. I suggest that we do one of two things:
Right now, Synapse's behaviour is about the worst possible option because it's totally unclear that the override is only one level deep. |
I'm currently working around this by creating the room with no power level overrides and waiting for it to be created. Then I read the power levels state, do my own deep merge in my application code, then send that back as a new state event. Kind of like this code except I do it immediately after the room is created.
As an appservice, I would much prefer to have this behaviour. The server's defaults are exactly what I want, I just want to modify one of the |
From the spec:
It's unclear what the exact override semantics are here. Is the entire generated
m.room.power_levels
content discarded and replaced with the object specified here (ie. potentially removing keys)? Are they deep-merged? If yes, what are the exact merge semantics?The text was updated successfully, but these errors were encountered: