Update to 0.23.1

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
This commit is contained in:
Jeremy Cline 2017-10-03 09:55:45 -04:00
parent 3bbc39514c
commit e07f1b6106
No known key found for this signature in database
GPG key ID: 9223308FA9B246DB
4 changed files with 56 additions and 3 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
/synapse-0.21.1.tar.gz /synapse-0.21.1.tar.gz
/synapse-0.22.0.tar.gz /synapse-0.22.0.tar.gz
/synapse-0.22.1.tar.gz /synapse-0.22.1.tar.gz
/synapse-0.23.1.tar.gz

View file

@ -0,0 +1,43 @@
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

@ -1,8 +1,8 @@
%global srcname synapse %global srcname synapse
Name: matrix-%{srcname} Name: matrix-%{srcname}
Version: 0.22.1 Version: 0.23.1
Release: 4%{?dist} Release: 1%{?dist}
Summary: A Matrix reference homeserver written in Python using Twisted Summary: A Matrix reference homeserver written in Python using Twisted
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/matrix-org/%{srcname} URL: https://github.com/matrix-org/%{srcname}
@ -11,11 +11,15 @@ Source1: synapse.sysconfig
# Upstream pins its version of pynacl: # Upstream pins its version of pynacl:
# https://github.com/matrix-org/synapse/issues/1642 # https://github.com/matrix-org/synapse/issues/1642
Patch0: 0001-Remove-the-strict-version-requirement-for-pynacl.patch 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 BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python2-setuptools BuildRequires: python2-setuptools
BuildRequires: python2-sphinx BuildRequires: python2-sphinx
BuildRequires: python2-affinity
BuildRequires: python2-bcrypt BuildRequires: python2-bcrypt
BuildRequires: python2-pyOpenSSL >= 0.14 BuildRequires: python2-pyOpenSSL >= 0.14
BuildRequires: python2-bleach >= 1.4.2 BuildRequires: python2-bleach >= 1.4.2
@ -47,6 +51,7 @@ BuildRequires: python2-yaml
BuildRequires: systemd BuildRequires: systemd
BuildRequires: python2-mock BuildRequires: python2-mock
Requires: python2-affinity
Requires: python2-bcrypt Requires: python2-bcrypt
Requires: python2-pyOpenSSL >= 0.14 Requires: python2-pyOpenSSL >= 0.14
Requires: python2-bleach >= 1.4.2 Requires: python2-bleach >= 1.4.2
@ -143,6 +148,10 @@ exit 0
%changelog %changelog
* Tue Oct 03 2017 Jeremy Cline <jeremy@jcline.org> - 0.23.1-1
- Update to latest upstream
- Include patch to work with ujson-2.0+
* Fri Sep 29 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.22.1-4 * Fri Sep 29 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.22.1-4
- Use python2 prefix for packages whenever possible - Use python2 prefix for packages whenever possible
- Add missing %%{?systemd_requires} - Add missing %%{?systemd_requires}

View file

@ -1 +1 @@
SHA512 (synapse-0.22.1.tar.gz) = 0f40ddf8e6ab90f6e1e416b4e6dc0e47b88040a6fb19e309ee26632efc1aeb32dd5a7cd26a060017ff2e6ba6320a15b64e0c29a9e8f491f334e1e742583eab7a SHA512 (synapse-0.23.1.tar.gz) = 2e1b12af21581386b2d30a1705e0803072a3e2225bd170743038e694a3e8ed01a3e4074b83b908d2f55ff7569fc8939a47527eb0a96d0ba031910b6965defb93