summary refs log tree commit diff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2020-09-03 16:49:58 -0400
committerHubert Chathi <hubert@uhoreg.ca>2020-09-03 17:12:31 -0400
commit88119731079256290a55c536a54b6017330205f3 (patch)
tree54dd21b321b30becbfe0d38bb2752591dfb44039
parentMerge remote-tracking branch 'origin/master' into uhoreg/dehydration_release (diff)
downloadsynapse-uhoreg/dehydration_release.tar.xz
-rw-r--r--synapse/storage/databases/main/devices.py5
-rw-r--r--synapse/storage/databases/main/end_to_end_keys.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/devices.py b/synapse/storage/databases/main/devices.py
index f9385a2c83..31094df4a1 100644
--- a/synapse/storage/databases/main/devices.py
+++ b/synapse/storage/databases/main/devices.py
@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import logging
+from canonicaljson import json
 from typing import Dict, Iterable, List, Optional, Set, Tuple
 
 from synapse.api.errors import Codes, StoreError
@@ -815,7 +816,7 @@ class DeviceWorkerStore(SQLBaseStore):
             self._store_dehydrated_device_txn,
             user_id,
             device_id,
-            json.dumps(device_data),
+            json_encoder.encode(device_data),
         )
 
     async def create_dehydration_token(
@@ -845,7 +846,7 @@ class DeviceWorkerStore(SQLBaseStore):
                         "token": token,
                         "user_id": user_id,
                         "device_id": device_id,
-                        "login_submission": json.dumps(login_submission),
+                        "login_submission": json_encoder.encode(login_submission),
                         "creation_time": self.hs.get_clock().time_msec(),
                     },
                     desc="create_dehydration_token",
diff --git a/synapse/storage/databases/main/end_to_end_keys.py b/synapse/storage/databases/main/end_to_end_keys.py
index a1291b06ff..3d105eb65c 100644
--- a/synapse/storage/databases/main/end_to_end_keys.py
+++ b/synapse/storage/databases/main/end_to_end_keys.py
@@ -288,7 +288,7 @@ class EndToEndKeyWorkerStore(SQLBaseStore):
                 },
                 values={
                     "key_id": key_id,
-                    "key_json": json.dumps(fallback_key),
+                    "key_json": json_encoder.encode(fallback_key),
                     "used": 0
                 },
                 desc="set_e2e_fallback_key"