diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-10-28 15:51:15 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-10-28 15:56:57 +0000 |
commit | b6ca69e4f109c745f022885ecb8aa86255f84ecf (patch) | |
tree | b7f9753346ab10425f93f9d77ebe937d112a6d57 /synapse/handlers/message.py | |
parent | 1.22.0 (diff) | |
download | synapse-b6ca69e4f109c745f022885ecb8aa86255f84ecf.tar.xz |
Remove frozendict_json_encoder and support frozendicts everywhere
Not being able to serialise `frozendicts` is fragile, and it's annoying to have to think about which serialiser you want. There's no real downside to supporting frozendicts, so let's just have one json encoder.
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index d6855c60ea..fb0a04e9a7 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -50,9 +50,8 @@ from synapse.replication.http.send_event import ReplicationSendEventRestServlet from synapse.storage.databases.main.events_worker import EventRedactBehaviour from synapse.storage.state import StateFilter from synapse.types import Requester, RoomAlias, StreamToken, UserID, create_requester -from synapse.util import json_decoder +from synapse.util import json_decoder, json_encoder from synapse.util.async_helpers import Linearizer -from synapse.util.frozenutils import frozendict_json_encoder from synapse.util.metrics import measure_func from synapse.visibility import filter_events_for_client @@ -928,7 +927,7 @@ class EventCreationHandler: # Ensure that we can round trip before trying to persist in db try: - dump = frozendict_json_encoder.encode(event.content) + dump = json_encoder.encode(event.content) json_decoder.decode(dump) except Exception: logger.exception("Failed to encode content: %r", event.content) |