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

Commit

Permalink
Merge remote-tracking branch 'origin/release-v1.38' into matrix-org-h…
Browse files Browse the repository at this point in the history
…otfixes
  • Loading branch information
erikjohnston committed Jul 22, 2021
2 parents c0121d6 + 7da24b9 commit 12c92ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/10457.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Always include `device_one_time_keys_count` key in `/sync` response to work around a bug in Element Android that broke encryption for new devices.
11 changes: 7 additions & 4 deletions synapse/rest/client/v2_alpha/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,13 @@ async def encode_response(self, time_now, sync_result, access_token_id, filter):
if sync_result.device_lists.left:
response["device_lists"]["left"] = list(sync_result.device_lists.left)

if sync_result.device_one_time_keys_count:
response[
"device_one_time_keys_count"
] = sync_result.device_one_time_keys_count
# We always include this because https://github.com/vector-im/element-android/issues/3725
# The spec isn't terribly clear on when this can be omitted and how a client would tell
# the difference between "no keys present" and "nothing changed" in terms of whole field
# absent / individual key type entry absent
# Corresponding synapse issue: https://github.com/matrix-org/synapse/issues/10456
response["device_one_time_keys_count"] = sync_result.device_one_time_keys_count

if sync_result.device_unused_fallback_key_types:
response[
"org.matrix.msc2732.device_unused_fallback_key_types"
Expand Down

0 comments on commit 12c92ee

Please sign in to comment.