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

Server capabilities support #4472

Merged
merged 17 commits into from Jan 30, 2019

Conversation

Projects
None yet
5 participants
@neilisfragile
Copy link
Contributor

neilisfragile commented Jan 25, 2019

Implements MSC1753 and MSC1804.

@neilisfragile neilisfragile changed the title track unstable room v3 Room capabilities support MSC1804 Jan 25, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 25, 2019

Codecov Report

Merging #4472 into develop will increase coverage by 0.05%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #4472      +/-   ##
===========================================
+ Coverage    74.69%   74.75%   +0.05%     
===========================================
  Files          336      338       +2     
  Lines        34293    34650     +357     
  Branches      5592     5668      +76     
===========================================
+ Hits         25614    25901     +287     
- Misses        7095     7149      +54     
- Partials      1584     1600      +16

@neilisfragile neilisfragile requested a review from matrix-org/synapse-core Jan 25, 2019

@richvdh
Copy link
Member

richvdh left a comment

looks good otherwise

@@ -118,6 +119,7 @@ class RoomVersions(object):
RoomVersions.V2,
RoomVersions.VDH_TEST,
RoomVersions.STATE_V2_TEST,
RoomVersions.V3,

This comment has been minimized.

@richvdh

richvdh Jan 25, 2019

Member

We can't add V3 here yet, because doing so will allow us to accept joins/creates for V3 rooms, but won't actually implement the things that make V3 V3.

@turt2live turt2live requested a review from matrix-org/synapse-core Jan 28, 2019

@turt2live

This comment has been minimized.

Copy link
Member

turt2live commented Jan 28, 2019

(sticking this back into the queue because I need it for Riot - sorry if I've picked the wrong person or something)

@turt2live
Copy link
Member

turt2live left a comment

This actually doesn't work as is. The servlet needs registering (see dbc8f50) and MSC1753 requires authentication on the endpoint.

For bonus points, supporting m.change_password would be awesome.

@turt2live turt2live removed the request for review from matrix-org/synapse-core Jan 28, 2019

@turt2live

This comment has been minimized.

Copy link
Member

turt2live commented Jan 29, 2019

Implementation for matrix-org/matrix-doc#1804

Concerns addressed

@neilisfragile neilisfragile changed the title Room capabilities support MSC1804 Server capabilities support MSC1753 MSC1804 Jan 29, 2019

@richvdh richvdh requested a review from matrix-org/synapse-core Jan 29, 2019

@richvdh richvdh changed the title Server capabilities support MSC1753 MSC1804 Server capabilities support Jan 29, 2019

"state-v2-test": "unstable",
}
},
"m.change_password": change_password,

This comment has been minimized.

@turt2live

turt2live Jan 29, 2019

Member

err, spec wants this to be {} at a minimum, not a boolean directly. I think we should modify the MSC to have this be the capability:

"m.change_password": {
  "enabled": true
}

This comment has been minimized.

@neilisfragile

neilisfragile Jan 29, 2019

Author Contributor

Done

@erikjohnston
Copy link
Member

erikjohnston left a comment

Looks good, just a few nits

@@ -104,6 +104,7 @@ class ThirdPartyEntityKind(object):
class RoomVersions(object):
V1 = "1"
V2 = "2"
V3 = "3"

This comment has been minimized.

@erikjohnston

erikjohnston Jan 29, 2019

Member

I don't think it matters, but I'm a bit surprised this is still in here.

This comment has been minimized.

@erikjohnston

erikjohnston Jan 30, 2019

Member

This comment is now updated due to #4515

},
}
})
)

This comment has been minimized.

@erikjohnston

erikjohnston Jan 29, 2019

Member

It'd be nicer if you could move this out of the defer.returnValue, i.e. something like:

response = {
    ...
}

defer.returnValue((200, response))

it just makes it a lot easier to see what's going on

(200, {
"capabilities": {
"m.room_versions": {
"default": "1",

This comment has been minimized.

@erikjohnston

erikjohnston Jan 29, 2019

Member

You should pull this in from synapse.api.constants

neilisfragile added some commits Jan 30, 2019

@erikjohnston erikjohnston merged commit 6587b0b into develop Jan 30, 2019

5 checks passed

ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

turt2live added a commit to matrix-org/matrix-doc that referenced this pull request Jan 31, 2019

Specify how capabilities work in the c2s API
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment