summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-07-17 11:52:27 +0100
committerJorik Schellekens <joriks@matrix.org>2019-07-17 14:37:25 +0100
commit7f282d17e6045443f27461b57dfa11155b68f771 (patch)
tree2b97be161e463b47527e1c9286f7208368856d62
parentMake sure there is an active span here. (diff)
downloadsynapse-7f282d17e6045443f27461b57dfa11155b68f771.tar.xz
Unbreak json parsing.
-rw-r--r--synapse/handlers/devicemessage.py2
-rw-r--r--synapse/storage/devices.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/devicemessage.py b/synapse/handlers/devicemessage.py
index 5963df4c1c..625b1b70af 100644
--- a/synapse/handlers/devicemessage.py
+++ b/synapse/handlers/devicemessage.py
@@ -118,7 +118,7 @@ class DeviceMessageHandler(object):
                     "message_id": message_id,
                     "context": json.dumps(context)
                     if opentracing.whitelisted_homeserver(destination)
-                    else "",
+                    else "{}",
                 }
 
         opentracing.log_kv({"local_messages": local_messages})
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py
index a17d7ec6a7..e985a1c665 100644
--- a/synapse/storage/devices.py
+++ b/synapse/storage/devices.py
@@ -222,7 +222,7 @@ class DeviceWorkerStore(SQLBaseStore):
                     "stream_id": stream_id,
                     "context": query_map[(user_id, device_id)][1]
                     if opentracing.whitelisted_homeserver(destination)
-                    else "",
+                    else "{}",
                 }
 
                 prev_id = stream_id
@@ -839,7 +839,7 @@ class DeviceStore(DeviceWorkerStore, BackgroundUpdateStore):
                     "ts": now,
                     "context": json.dumps(context)
                     if opentracing.whitelisted_homeserver(destination)
-                    else "",
+                    else "{}",
                 }
                 for destination in hosts
                 for device_id in device_ids