mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 08:49:25 -05:00
Always send device_one_time_keys_count (#10457)
As per comment Fixes https://github.com/matrix-org/synapse/issues/10456 See also https://github.com/vector-im/element-android/issues/3725
This commit is contained in:
parent
519ec8271f
commit
7da24b975d
1
changelog.d/10457.bugfix
Normal file
1
changelog.d/10457.bugfix
Normal file
@ -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.
|
@ -252,10 +252,13 @@ class SyncRestServlet(RestServlet):
|
|||||||
if sync_result.device_lists.left:
|
if sync_result.device_lists.left:
|
||||||
response["device_lists"]["left"] = list(sync_result.device_lists.left)
|
response["device_lists"]["left"] = list(sync_result.device_lists.left)
|
||||||
|
|
||||||
if sync_result.device_one_time_keys_count:
|
# We always include this because https://github.com/vector-im/element-android/issues/3725
|
||||||
response[
|
# The spec isn't terribly clear on when this can be omitted and how a client would tell
|
||||||
"device_one_time_keys_count"
|
# the difference between "no keys present" and "nothing changed" in terms of whole field
|
||||||
] = sync_result.device_one_time_keys_count
|
# 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:
|
if sync_result.device_unused_fallback_key_types:
|
||||||
response[
|
response[
|
||||||
"org.matrix.msc2732.device_unused_fallback_key_types"
|
"org.matrix.msc2732.device_unused_fallback_key_types"
|
||||||
|
Loading…
Reference in New Issue
Block a user