Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2483 from jeremycline/unfreeze-ujson-dump
Browse files Browse the repository at this point in the history
Unfreeze event before serializing with ujson
  • Loading branch information
erikjohnston authored Oct 11, 2017
2 parents 84e27a5 + cafb8de commit bc7f3eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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
Expand Down Expand Up @@ -555,7 +556,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)
Expand Down

0 comments on commit bc7f3eb

Please sign in to comment.