summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-08 16:21:17 +0100
committerErik Johnston <erik@matrix.org>2019-10-08 16:28:57 +0100
commit1d3858371e9577faf3382d1feee97154e5085cd4 (patch)
tree16e3cdff3dcc88b6f4b2dbf21247926f514dcd44 /synapse/storage/pusher.py
parentFix existing hex encoded json values in DB (diff)
downloadsynapse-1d3858371e9577faf3382d1feee97154e5085cd4.tar.xz
Disable bytes usage with postgres
More often than not passing bytes to `txn.execute` is a bug (where we
meant to pass a string) that just happens to work if `BYTEA_OUTPUT` is
set to `ESCAPE`. However, this is a bit of a footgun so we want to
instead error when this happens, and force using `bytearray` if we
actually want to use bytes.
Diffstat (limited to 'synapse/storage/pusher.py')
-rw-r--r--synapse/storage/pusher.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index 3e0e834a62..b12e80440a 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -241,7 +241,7 @@ class PusherStore(PusherWorkerStore):
                     "device_display_name": device_display_name,
                     "ts": pushkey_ts,
                     "lang": lang,
-                    "data": encode_canonical_json(data),
+                    "data": bytearray(encode_canonical_json(data)),
                     "last_stream_ordering": last_stream_ordering,
                     "profile_tag": profile_tag,
                     "id": stream_id,