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

Improve documentation around EDUs and PDUs #1463

Merged
merged 10 commits into from
Aug 8, 2018

Conversation

turt2live
Copy link
Member

Rendered: see 'docs' commit status


Clarify fields, improve examples, and make the tables in the spec be generated rather than duplicated.

Clarify fields, improve examples, and make the tables in the spec be generated rather than duplicated.
@turt2live turt2live requested a review from a team July 31, 2018 20:00
example: {"key": "value"}
properties:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: these are defined because many clients rely on them, and they are relatively generic. They are all optional though.

os.path.join(matrix_doc_dir, "api/application-service/definitions"): "as",
os.path.join(matrix_doc_dir, "api/client-server/definitions"): "cs",
#os.path.join(matrix_doc_dir, "api/identity/definitions"): "is",
#os.path.join(matrix_doc_dir, "api/push-gateway/definitions"): "push",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push and identity don't have definitions, so we shouldn't explode

@turt2live turt2live mentioned this pull request Jul 31, 2018
35 tasks
@turt2live turt2live mentioned this pull request Aug 3, 2018
6 tasks
We fixed the EDU, so we don't need this comment.
This is useful for when we start defining event schemas. This also has a sanity check for ensuring the directory exists, allowing the IS and push API paths to be uncommented.
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the changes to the python swagger files, they're a bit of a mystery to me

age_ts:
type: integer
format: int64
description: The POSIX timestamp this message was sent at in milliseconds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its probably a bug if age_ts is coming down the wire, as its an estimate used internally in synapse to track what the age param should be (and isn't the same as origin_server_ts)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at it again, this seems to not make it down the wire but where I was looking at the time does imply it does. Will remove.

content:
type: object
description: The content of the ephemeral message.
required: ['edu_type', 'origin', 'destination', 'content']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empirically we don't send either origin or destination across federation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the code seems to point to both being sent, unless something I didn't see somehow drops them? I suppose I could actually test it somehow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can confirm: apparently synapse does not send those fields. Will flag as optional.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. TBH I'd omit them entirely to avoid confusion, since its one less thing that we'd need to check/auth (to avoid the origin in the content being different from the origin in the HTTP request headers, etc.)

@erikjohnston
Copy link
Member

Is it possible to somehow reuse the event swagger definitions for unsigned PDUs? Maybe by having signed events extend unsigned PDUs? It seems a shame to duplicate the definitions of the fields

@turt2live
Copy link
Member Author

Which duplication in particular? It should be possible to have things extend the unsigned PDU, although I don't see where this PR can benefit from doing that.

@turt2live
Copy link
Member Author

Have updated this. The python stuff adds a way for definitions (schemas) to appear in the spec without the formal structure of an HTTP API. It does this by adding a new generated section and populating the variable space with the values, leading to definitions being available in the RST.

@turt2live turt2live assigned erikjohnston and unassigned turt2live Aug 7, 2018
@erikjohnston
Copy link
Member

Which duplication in particular? It should be possible to have things extend the unsigned PDU, although I don't see where this PR can benefit from doing that.

I guess I'm assuming that we already have a signed PDU schema somewhere already?

@turt2live
Copy link
Member Author

The only signed PDU schema I could find was a table in the RST, which doesn't really help anyone.

(also have removed the unused EDU fields)

@erikjohnston
Copy link
Member

Ah, pdu.yaml already inherits from unsigned_pdy.yaml

@turt2live turt2live merged commit 0f8954d into matrix-org:master Aug 8, 2018
@turt2live turt2live deleted the travis/s2s/pdus-and-edus branch August 8, 2018 14:02
RiotTranslateBot pushed a commit to RiotTranslateBot/matrix-doc that referenced this pull request Aug 22, 2023
Signed-off-by: Stuart Mumford <stuart@cadair.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants