Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

make sure etag is a string for GET room_keys/version #7691

Merged
merged 4 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7691.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix an incorrect type in the `GET room_keys/version` endpoint.
clokep marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions synapse/handlers/e2e_room_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ def get_version_info(self, user_id, version=None):
raise

res["count"] = yield self.store.count_e2e_room_keys(user_id, res["version"])
res["etag"] = str(res["etag"])
Copy link
Member

Choose a reason for hiding this comment

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

I checked briefly on Friday and this matches the other places we call get_e2e_room_keys_version_info.

return res

@trace
Expand Down
1 change: 1 addition & 0 deletions tests/handlers/test_e2e_room_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_create_version(self):
# check we can retrieve it as the current version
res = yield self.handler.get_version_info(self.local_user)
version_etag = res["etag"]
self.assertIsInstance(version_etag, str)
del res["etag"]
self.assertDictEqual(
res,
Expand Down