Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

/createRoom results in a 403 + created room when mixing up the power levels #5579

Closed
turt2live opened this issue Jun 28, 2019 · 13 comments
Closed
Assignees
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@turt2live
Copy link
Member

Creating a room with a name and power_level_content_override which doesn't list the creator as having power results in the correct "403 you don't have enough power" response, however the room is still created and synced down to the user. It should not be created.

@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Jul 3, 2019
@t3chguy
Copy link
Member

t3chguy commented Jul 7, 2019

Why

It should not be created

as opposed to defaulting to 100 if not provided

@t3chguy
Copy link
Member

t3chguy commented Jul 7, 2019

The spec in unclear in the granularity of the override, it does not say whether to do it on a depth=1 only or not:

Overridden by the power_level_content_override parameter.

@turt2live
Copy link
Member Author

I'd argue that https://matrix.org/docs/spec/client_server/r0.5.0#post-matrix-client-r0-createroom is pretty clear about the order of application.

@t3chguy
Copy link
Member

t3chguy commented Jul 7, 2019

Yes, but it doesn't say how to interpret power_level_content_override

Whether

power_level_content_override:

"users": {
    "@not_creator:server": 100
}

when overriding

...
"users": {
    "@creator:server": 100
}
...

ends up including both of the users, or it merged on a depth of 1 only,

synapse implementation overrides each key, so does not merge users, and therefore the creator disappears

@turt2live
Copy link
Member Author

The intention is that the spec says it overrides the entire structure, not just at the root level. If that's unclear, please open a spec clarification.

@t3chguy
Copy link
Member

t3chguy commented Jul 7, 2019

Oh right, in synapse it uses a dict update,which is why it confused me. I'll fix it in synapse tomorrow

@t3chguy
Copy link
Member

t3chguy commented Jul 8, 2019

Corrected Synapse to match the above:

The intention is that the spec says it overrides the entire structure, not just at the root level. If that's unclear, please open a spec clarification.

@richvdh
Copy link
Member

richvdh commented Jul 18, 2019

The intention is that the spec says it overrides the entire structure, not just at the root level. If that's unclear, please open a spec clarification.

The spec currently says of power_level_content_override:

This object is applied on top of the generated m.room.power_levels event content prior to it being sent to the room

"on top of" definitely suggests a merge, not an overwrite, to me, though I agree it's unclear how deep the merge should go. It feels like synapse kinda matches the spec at the moment, though.

@turt2live: are you sure about this?

@turt2live
Copy link
Member Author

I was sure, but that quote leads me to believe that my life has been a lie. We should probably have a quick poll as the spec team and standardize on the winner.

@richvdh
Copy link
Member

richvdh commented Jul 22, 2019

my main feeling on that is that the spec says what it says, and synapse seems to basically match it. There may be valid reasons to change it, but they probably need an MSC and I'm unconvinced they are worthwhile.

To return to the topic of this bug: there are probably hundreds of ways of specifying broken parameters to a createRoom call, all of which lead to a broken room being created... :/

@t3chguy
Copy link
Member

t3chguy commented Jul 25, 2019

We should probably have a quick poll as the spec team and standardize on the winner.

Any update on this?

@turt2live
Copy link
Member Author

@t3chguy no. #5579 (comment) is the last comment since then.

It was also a suggestion, not an action I plan on taking right now (hence "probably"). The core team is a bit involved with too many issues to worry about the subtleties of /createRoom at the moment. I would recommend at the very least opening a clarification PR to the spec as I said here: #5579 (comment)

@t3chguy
Copy link
Member

t3chguy commented Aug 15, 2019

Fixed by #5633

@t3chguy t3chguy closed this as completed Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants