Drop patch accepted by upstream

This commit is contained in:
Jeremy Cline 2018-01-10 15:53:20 -05:00
parent 1cb61c34e3
commit 60d1916d9d
No known key found for this signature in database
GPG key ID: 9223308FA9B246DB
2 changed files with 0 additions and 46 deletions

View file

@ -1,43 +0,0 @@
From cafb8de132999507e9b05c751fbb32d199e7de50 Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org>
Date: Sat, 30 Sep 2017 11:22:37 -0400
Subject: [PATCH] Unfreeze event before serializing with ujson
In newer versions of https://github.com/esnme/ultrajson, ujson does not
serialize frozendicts (introduced in esnme/ultrajson@53f85b1). Although
the PyPI version is still 1.35, Fedora ships with a build from commit
esnme/ultrajson@2f1d487. This causes the serialization to fail if the
distribution-provided package is used.
This runs the event through the unfreeze utility before serializing it.
Thanks to @ignatenkobrain for tracking down the root cause.
fixes #2351
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
---
synapse/handlers/message.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index be4f123c5..fe9d8848b 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -26,6 +26,7 @@
from synapse.util.async import run_on_reactor, ReadWriteLock, Limiter
from synapse.util.logcontext import preserve_fn
from synapse.util.metrics import measure_func
+from synapse.util.frozenutils import unfreeze
from synapse.visibility import filter_events_for_client
from ._base import BaseHandler
@@ -503,7 +504,7 @@ def handle_new_client_event(
# Ensure that we can round trip before trying to persist in db
try:
- dump = ujson.dumps(event.content)
+ dump = ujson.dumps(unfreeze(event.content))
ujson.loads(dump)
except:
logger.exception("Failed to encode content: %r", event.content)

View file

@ -11,9 +11,6 @@ Source1: synapse.sysconfig
# Upstream pins its version of pynacl:
# https://github.com/matrix-org/synapse/issues/1642
Patch0: 0001-Remove-the-strict-version-requirement-for-pynacl.patch
# Compatibility with ujson-2.0+
# https://github.com/matrix-org/synapse/pull/2483
Patch1: 2483-unfreeze-event-for-ujson-2.0-compat.patch
BuildArch: noarch
BuildRequires: python2-devel