-
-
Notifications
You must be signed in to change notification settings - Fork 120
Specification for MSC4311: Create event availability in stripped state #2207
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
Changes from 8 commits
a07f2d0
1692d22
8ce5903
c3107d4
c231d6f
430cbd6
a678f0b
86358e7
f9e573f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Invites and knocks are now expected to contain the `m.room.create` event in their stripped state entries, as per [MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`invite_room_state` and `knock_room_state` now have additional requirements and validation depending on the room version, as per [MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{"$ref": "./minimal_pdu.json"}, | ||
{ | ||
"type": "m.room.create", | ||
"content": { | ||
"see_room_version_spec": "The event format changes depending on the room version." | ||
} | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,13 +71,34 @@ paths: | |
properties: | ||
invite_room_state: | ||
type: array | ||
x-changedInMatrixVersion: | ||
"1.16": | | ||
`m.room.create` and format requirements were added. | ||
Comment on lines
+74
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I am belatedly wishing that we had just deprecated Do you think it's worth trying to do some $ref trickery to reduce the duplication in the yaml, at least? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been bitten by If given a choice, I'd rather not fight There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that @zecakeh has done a bunch of work to make
Ok, but you don't have to duplicate the whole endpoint -- you can just share some parameter type definitions, for example. I'm really not a big fan of having two copies of all this stuff - it makes it much harder to maintain and review. Doing this review was particularly annoying because I kept getting confused about which bits I'd seen and which I hadn't. Making the job harder for the reviewer to save a bit of authoring time is not a great investment. I'll not insist on it this time around though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The concern with the error responses is that it's harder to deduplicate that part is all - the request parameters can be deduplicated, but that's only so helpful. I'll experiment with |
||
description: |- | ||
An optional list of [stripped state events](/client-server-api/#stripped-state) | ||
to help the receiver of the invite identify the room. | ||
A list of state events to help the receiver of the invite identify the room. | ||
Translated as [stripped state events](/client-server-api/#stripped-state) | ||
over the Client-Server API. | ||
|
||
MUST contain the `m.room.create` event for the room. All events listed | ||
MUST additionally be formatted according to the room version specification. | ||
|
||
Servers might need to apply validation to the `invite_room_state` depending | ||
on room version. See the `400 M_MISSING_PARAM` error definition for more | ||
information. | ||
|
||
Note that events have a different format depending on the room | ||
version - check the [room version specification](/rooms) for | ||
precise event formats. | ||
items: | ||
$ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml | ||
type: object | ||
title: PDU | ||
properties: {} | ||
description: |- | ||
Note that events have a different format depending on the room | ||
version - check the [room version specification](/rooms) for | ||
precise event formats. | ||
example: | ||
$ref: ../../event-schemas/examples/invite_room_state.json | ||
$ref: ./examples/invite_or_knock_state.json | ||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
type: object | ||
required: true | ||
responses: | ||
|
@@ -118,24 +139,7 @@ paths: | |
"origin_server_ts": 1549041175876, | ||
"sender": "@someone:example.org", | ||
"unsigned": { | ||
"invite_room_state": [ | ||
{ | ||
"type": "m.room.name", | ||
"sender": "@bob:example.org", | ||
"state_key": "", | ||
"content": { | ||
"name": "Example Room" | ||
} | ||
}, | ||
{ | ||
"type": "m.room.join_rules", | ||
"sender": "@bob:example.org", | ||
"state_key": "", | ||
"content": { | ||
"join_rule": "invite" | ||
} | ||
} | ||
] | ||
"invite_room_state": {"$ref": "./examples/invite_or_knock_state.json"} | ||
}, | ||
"content": { | ||
"membership": "invite" | ||
|
@@ -168,6 +172,35 @@ paths: | |
"errcode": "M_FORBIDDEN", | ||
"error": "User cannot invite the target user." | ||
} | ||
"400": | ||
description: |- | ||
The `M_MISSING_PARAM` error code is used to indicate one or more of | ||
the following: | ||
|
||
* The `m.room.create` event is missing from `invite_room_state`. | ||
* One or more entries in `invite_room_state` are not formatted according | ||
to the room's version. | ||
* One or more events fails a [signature check](/server-server-api/#validating-hashes-and-signatures-on-received-events). | ||
* One or more events does not reside in the same room as the invite. | ||
Note: Some room versions may require calculating the room ID for an | ||
event rather than relying on the presence of `room_id`. | ||
|
||
Servers MAY apply the validation above to room versions 1 through 11, | ||
and SHOULD apply the validation above to all other room versions. | ||
|
||
If `M_MISSING_PARAM` is returned and the request is associated with a | ||
Client-Server API request, the Client-Server API request SHOULD fail | ||
with a 5xx error rather than being passed through. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../client-server/definitions/errors/error.yaml | ||
examples: | ||
response: | ||
value: { | ||
"errcode": "M_MISSING_PARAM", | ||
"error": "Create event not among invite state entries." | ||
} | ||
servers: | ||
- url: "{protocol}://{hostname}{basePath}" | ||
variables: | ||
|
Uh oh!
There was an error while loading. Please reload this page.