summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-29 17:43:46 +0100
committerErik Johnston <erik@matrix.org>2015-04-29 17:43:46 +0100
commit472be886740edf5f9eb08f234063a7d57f70442b (patch)
tree42536439b57611b4935d89ce54bc1905f16e3868 /synapse/storage/pusher.py
parentFix off by one in presence token handling (diff)
downloadsynapse-472be886740edf5f9eb08f234063a7d57f70442b.tar.xz
We store pusher data as bytes
Diffstat (limited to 'synapse/storage/pusher.py')
-rw-r--r--synapse/storage/pusher.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index feb2870dfe..57690c3ef5 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -53,7 +53,7 @@ class PusherStore(SQLBaseStore):
             dataJson = r['data']
             r['data'] = None
             try:
-                r['data'] = json.loads(dataJson)
+                r['data'] = json.loads(str(dataJson).decode("UTF8"))
             except:
                 logger.warn("Invalid JSON in data for pusher %d: %s", r['id'], dataJson)
                 pass
@@ -81,7 +81,7 @@ class PusherStore(SQLBaseStore):
                     device_display_name=device_display_name,
                     ts=pushkey_ts,
                     lang=lang,
-                    data=encode_canonical_json(data).decode("UTF-8"),
+                    data=encode_canonical_json(data),
                 ),
                 insertion_values=dict(
                     id=next_id,