summary refs log tree commit diff
path: root/synapse/storage/stats.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-04 16:58:38 +0100
committerErik Johnston <erik@matrix.org>2019-06-04 16:58:38 +0100
commit544e101c24c5f5ec088d8b09453253a1ffb81cec (patch)
tree91152c9644786758b0706312cb10271de31fdc1e /synapse/storage/stats.py
parenthotfix RetryLimiter (diff)
parentMerge pull request #5341 from matrix-org/babolivier/email_config (diff)
downloadsynapse-544e101c24c5f5ec088d8b09453253a1ffb81cec.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/stats.py')
-rw-r--r--synapse/storage/stats.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py

index 1c0b183a56..ff266b09b0 100644 --- a/synapse/storage/stats.py +++ b/synapse/storage/stats.py
@@ -328,6 +328,22 @@ class StatsStore(StateDeltasStore): room_id (str) fields (dict[str:Any]) """ + + # For whatever reason some of the fields may contain null bytes, which + # postgres isn't a fan of, so we replace those fields with null. + for col in ( + "join_rules", + "history_visibility", + "encryption", + "name", + "topic", + "avatar", + "canonical_alias" + ): + field = fields.get(col) + if field and "\0" in field: + fields[col] = None + return self._simple_upsert( table="room_state", keyvalues={"room_id": room_id},