-
Notifications
You must be signed in to change notification settings - Fork 379
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
Add general clarity to the /createRoom endpoint #1518
Add general clarity to the /createRoom endpoint #1518
Conversation
This commit does a number of things: * Minor formatting/alignment changes * Document the room_alias response key. This could be deprecated now, or forfeited, if needed. * Remove the guest_can_join parameter - it is not actually supported * Document the previously undocumented power_level_content_override parameter * Clarify that the room_id is required on the response * More clearly spell out which events are created as part of the request * Clarify how the room alias becomes the canonical alias * Clarify how the `visibility` may be used to determine a default preset to apply * Document the `m.federate` creation content parameter, adding an option for the homeserver to define a default value References: * Preset being inferred by the visibility: https://github.com/matrix-org/synapse/blob/cd32c19a604549b4518d748c07149d140bc9e063/synapse/handlers/room.py#L172-L177 * Power level content overrides: * https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L198 * https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L335-L359 * Aliases becoming canonical: https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L366-L370 * `m.federate` landing in the create event: https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L311-L315 Fixes https://github.com/matrix-org/matrix-doc/issues/1243 Fixes matrix-org#1471 Inspired by matrix-org#1213
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 endpoint might get a prize for being the most byzantine API in the whole of matrix, and there is some competition :/
api/client-server/create_room.yaml
Outdated
@@ -196,10 +223,17 @@ paths: | |||
type: string | |||
description: |- | |||
The created room's ID. | |||
room_alias: |
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.
it sounds like we need to reach an agreement over what to do with this. I can't entirely remember why I was in favour of removing it, but either way I'd like us to discuss it before committing to it.
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.
#1243 makes it sound like your opinion was that we aren't this helpful in other endpoints.
api/client-server/create_room.yaml
Outdated
@@ -89,6 +96,11 @@ paths: | |||
``private`` visibility if this key is not included. NB: This | |||
should not be confused with ``join_rules`` which also uses the | |||
word ``public``. | |||
|
|||
If no ``preset`` is specificed, the server may use the visbility |
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 this might be clearer specified against the preset
property rather than here.
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.
Also, a "may" specification here is kinda useless imho; the only reason for speccing it would be if the client could rely on it happening. Assuming we don't want to deprecate this behaviour, this should be at least a "should".
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.
will go with 'should' and move it to the preset. This is one of those cases where I was looking at synapse and ran across the if
statement that does this and thought it was worth including.
api/client-server/create_room.yaml
Outdated
@@ -145,6 +160,14 @@ paths: | |||
The server will clobber the following keys: ``creator``. Future | |||
versions of the specification may allow the server to clobber | |||
other keys. | |||
properties: |
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.
speccing this fails to make it clear that m.federate
is just one example of a property that can be set here. It might be better just to say "extra keys... such as m.federate
" and link to the m.room.create event schema spec.
api/client-server/create_room.yaml
Outdated
event. This object is applied on top of the generated power | ||
level event prior to it being sent to the room. Defaults | ||
to overriding nothing. | ||
$ref: "definitions/event-schemas/power_level_content_schema.yaml" |
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.
Can we just link to the m.room.power_levels event rather than duplicating the whole content in the spec - not least because anyone implementing this endpoint needs to inspect the two sections carefully to make sure that they actually are the same.
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.
tbh I'm not a huge fan of linking between different sections, as it leads to infinite new tabs when trying to implement something. Would a link + keeping the $ref
be okay?
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.
actually it kinda makes more sense to put it as a link only, similar to m.federate
. Will do that instead.
The argument is that this isn't really needed at this time.
I have removed |
hum, why is there no |
Good question. The docs are here though: https://515-24998719-gh.circle-artifacts.com/0/root/project/scripts/gen/index.html (as of writing this 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.
an example for power_levels_content
wouldn't have gone amiss, but lgtm
The words already say this is deprecated, but it was missing the flag.
Rendered: see 'docs' status check
This commit does a number of things:
visibility
may be used to determine a default preset to applym.federate
creation content parameter, adding an option for the homeserver to define a default valueReferences:
m.federate
landing in the create event: https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L311-L315Fixes #1243
Fixes #1471
Inspired by #1213
Fixes #681