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

MSC1753: client-server capabilities API #1753

Merged
merged 7 commits into from
Jan 9, 2019

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 12, 2018

@richvdh richvdh added proposal-in-review proposal A matrix spec change proposal labels Dec 12, 2018
@turt2live
Copy link
Member

Simple and straightforward - lgtm!

proposals/1753-capabilities.md Outdated Show resolved Hide resolved
proposals/1753-capabilities.md Outdated Show resolved Hide resolved
@richvdh richvdh self-assigned this Dec 13, 2018
query, where a server would return all possible supported operations. The
problem with this is that it may add load to the server, and increase network
traffic, by returning a large number of features which the client may have no
interest in.
Copy link
Member

Choose a reason for hiding this comment

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

This sounds slightly spurious to me, tbh. You'd need quite a large set of capabilities before it'd be noticeable I'd have thought (especially when using compression). I also wouldn't expect it be queried very often by clients, so compared to /sync and co I think the traffic/load would be negligible?

OTOH, I'm not against using a POST, though I kinda expect a lot of folks to ask why they can't simply do a GET (I could certainly see myself wanting to query everything to debug what's going on)

Copy link
Member Author

Choose a reason for hiding this comment

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

My concern is less about network traffic and more about a world where a server is divided up into microservices so has to go and ask lots of other bits of the system for answers on the capabilities - or even just do database queries or whatever.

@erikjohnston
Copy link
Member

Broadly LGTM, other than I'm wondering slightly about having GET, and perhaps we might (in future) want to consider adding a capabilities section to sync so clients can see changes?

@ara4n
Copy link
Member

ara4n commented Dec 17, 2018

it generally lgtm. i think it'd also be nice to support GET to discover what caps are around as an fyi (even if we don't know what to do with them), even though clients would in practice typically POST to do discover specific caps.

A nagging part of my brain is wondering whether should put these as state in a server room (same as the server msgs room?) to avoid creating yet another custom API and to get realtime sync for free, etc.

@richvdh
Copy link
Member Author

richvdh commented Dec 17, 2018

it generally lgtm. i think it'd also be nice to support GET to discover what caps are around as an fyi (even if we don't know what to do with them), even though clients would in practice typically POST to do discover specific caps.

Surely clients are going to use the GET if it's available, thus defeating the point of the POST. I don't feel that strongly about whether it should be GET or POST, but having both seems to be the worst of all worlds.

@richvdh
Copy link
Member Author

richvdh commented Dec 17, 2018

A nagging part of my brain is wondering whether should put these as state in a server room (same as the server msgs room?) to avoid creating yet another custom API and to get realtime sync for free, etc.

that sounds much more complicated to implement. Why is a custom API so much worse than custom event types?

@ara4n
Copy link
Member

ara4n commented Dec 18, 2018

that sounds much more complicated to implement. Why is a custom API so much worse than custom event types?

because it’s another set of endpoints to be specced, impl’d and maintained - and a new section to /sync if we want it pushed to the client in realtime. i’m surprised it seems more complicated, but i may be missing something?

To be clear: i am just trying to do the thought experiment here to ensure we evaluate both options sufficiently.

@richvdh
Copy link
Member Author

richvdh commented Dec 18, 2018

All I want for Christmas is threading.

because it’s another set of endpoints to be specced, impl’d and maintained

one endpoint, which seems to compare very favourably to one custom event type which also has to be specced, impl’d and maintained.

  • and a new section to /sync if we want it pushed to the client in realtime. i’m surprised it seems more complicated, but i may be missing something?

Let's suppose we change the configuration on the server so that users can no longer change their passwords. That means that the server needs to (a) spot that config change has been made, which may be non-trivial, and then (b) create a state event for every single user who has ever used the server so that it's ready for the client next time it syncs. That process may take a long time, so we need to be able to resume it halfway through.

As an alternative to (b), maybe we wait until the client syncs before creating a new event, but then that feels very similar to adding a new section to /sync.

Compare that with a simple endpoint that the client can go and check when it cares about something?

@richvdh
Copy link
Member Author

richvdh commented Dec 21, 2018

Based on the feedback here, I'm going to update the proposal to suggest a simple GET /_matrix/client/r0/capabilities API instead of the POST API. I don't really see the value in having both - it just feels like needless complication in the server and API.

@richvdh
Copy link
Member Author

richvdh commented Dec 24, 2018

It seems a bit unfair to call a FCP on this over Christmas, but if folks could let me know if they have anything else to add that would be helpful, so we can FCP it in January.

@richvdh
Copy link
Member Author

richvdh commented Jan 2, 2019

ok folks I'd like to propose an FCP for this.

@richvdh
Copy link
Member Author

richvdh commented Jan 2, 2019

@mscbot fcp merge

@mscbot
Copy link
Collaborator

mscbot commented Jan 2, 2019

Team member @richvdh has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@mscbot mscbot added proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. disposition-merge labels Jan 2, 2019
@matrix-org matrix-org deleted a comment from mscbot-test Jan 2, 2019
proposals/1753-capabilities.md Outdated Show resolved Hide resolved
proposals/1753-capabilities.md Outdated Show resolved Hide resolved
proposals/1753-capabilities.md Outdated Show resolved Hide resolved
turt2live and others added 3 commits January 3, 2019 17:40
r0/versions isn't a thing

Co-Authored-By: richvdh <1389908+richvdh@users.noreply.github.com>
r0/versions isn't a thing

Co-Authored-By: richvdh <1389908+richvdh@users.noreply.github.com>
r0/versions isn't a thing

Co-Authored-By: richvdh <1389908+richvdh@users.noreply.github.com>
@anoadragon453
Copy link
Member

lgtm.

@mscbot reviewed

@mscbot mscbot added final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. and removed proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. labels Jan 4, 2019
@mscbot
Copy link
Collaborator

mscbot commented Jan 4, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added finished-final-comment-period and removed final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. labels Jan 9, 2019
@mscbot
Copy link
Collaborator

mscbot commented Jan 9, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

@anoadragon453 anoadragon453 merged commit ec97e1e into master Jan 9, 2019
turt2live added a commit that referenced this pull request Jan 31, 2019
Original proposals:
* #1753
* #1804

Implementation proof:
* matrix-org/synapse#4472
* matrix-org/matrix-js-sdk#830

There is one change to MSC1753 which is included in this commit. MSC1804 remains unchanged. In the original proposal, the change password capability being present was an indication that password changes were possible. It was found that this doesn't really communicate the state very well to clients in that lack of a capability (or a 404, etc) would mean that users would erroneously not be able to change their passwords. A simple boolean flag was added to assist clients in detecting this capability.
@turt2live turt2live added spec-pr-in-review A proposal which has been PR'd against the spec and is in review merged A proposal whose PR has merged into the spec! and removed finished-final-comment-period spec-pr-in-review A proposal which has been PR'd against the spec and is in review labels Jan 31, 2019
@turt2live
Copy link
Member

Merged via #1829 🎉

@turt2live turt2live added the kind:feature MSC for not-core and not-maintenance stuff label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge kind:feature MSC for not-core and not-maintenance stuff merged A proposal whose PR has merged into the spec! proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants