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

Use the correct request body for the /keys/query endpoint. #1307

Merged
merged 5 commits into from
Apr 7, 2020

Conversation

MTRNord
Copy link
Contributor

@MTRNord MTRNord commented Apr 7, 2020

According to https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-keys-query

The request should contain:

{
  "device_keys": {
    "@alice:example.com": []
  }
}

instead of

{
  "device_keys": {
    "@alice:example.com": {}
  }
}

which currently gets send.

Signed-off-by: Marcel Radziomtrnord1@gmail.com

@t3chguy t3chguy requested a review from a team April 7, 2020 12:27
@MTRNord
Copy link
Contributor Author

MTRNord commented Apr 7, 2020

Not removing tests until it is certain that spec is correct and riot is wrong :D Sometimes the spec isn't updates fast enough

Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Hmm, thanks for looking at this! I think it may be an error in the spec, but let's ask @uhoreg to double check.

@jryans jryans requested a review from uhoreg April 7, 2020 13:43
@MTRNord
Copy link
Contributor Author

MTRNord commented Apr 7, 2020

People at ruma (and Timo who implements the new rust server) found this. I am only implementing their findings in riot/react-sdk/js-sdk as I have knowledge about riot stuff :)

@uhoreg
Copy link
Member

uhoreg commented Apr 7, 2020

The spec and this PR are correct. It's an array of device IDs, or an empty array if the query is for all devices. Synapse just does a if not device_ids to check if it's empty, which works with both arrays and objects, which is why synapse doesn't complain about it.

Once the unit tests are fixed, this should be fine to merge.

@jryans jryans added the Z-Community-PR Issue is solved by a community member's PR label Apr 7, 2020
@MTRNord
Copy link
Contributor Author

MTRNord commented Apr 7, 2020

@uhoreg @jryans all 4 tests should be fixed. Was a bit hard to find them all as the error log of the tests is not really helping (especially the last one was kinda hard to find)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants