summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-09-01 11:00:00 +0100
committerBrendan Abolivier <babolivier@matrix.org>2021-09-01 11:00:00 +0100
commitcc633a699de20173d0edcd13897929ca9e7a5a98 (patch)
tree43576f013f051a6b8bf0abb009fe68c99cd235ed /synapse
parentMerge tag 'v1.38.0' into babolivier/dinsic_1.41.0 (diff)
parent 1.38.1 (diff)
downloadsynapse-cc633a699de20173d0edcd13897929ca9e7a5a98.tar.xz
Merge tag 'v1.38.1' into babolivier/dinsic_1.41.0
Synapse 1.38.1 (2021-07-22)
===========================

Bugfixes
--------

- 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. ([\#10457](https://github.com/matrix-org/synapse/issues/10457))
Diffstat (limited to 'synapse')
-rw-r--r--synapse/__init__.py2
-rw-r--r--synapse/rest/client/v2_alpha/sync.py11
2 files changed, 8 insertions, 5 deletions
diff --git a/synapse/__init__.py b/synapse/__init__.py
index 5ecce24eee..7ea5a790db 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -47,7 +47,7 @@ try:
 except ImportError:
     pass
 
-__version__ = "1.38.0"
+__version__ = "1.38.1"
 
 if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
     # We import here so that we don't have to install a bunch of deps when
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py
index ecbbcf3851..32e8500795 100644
--- a/synapse/rest/client/v2_alpha/sync.py
+++ b/synapse/rest/client/v2_alpha/sync.py
@@ -252,10 +252,13 @@ class SyncRestServlet(RestServlet):
         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"