anonymousland-synapse/synapse
Andrew Morgan 7b06f85c0e
Ensure we use a copy of the event content dict before modifying it in serialize_event (#9585)
This bug was discovered by DINUM. We were modifying `serialized_event["content"]`, which - if you've got `USE_FROZEN_DICTS` turned on or are [using a third party rules module](17cd48fe51/synapse/events/third_party_rules.py (L73-L76)) - will raise a 500 if you try to a edit a reply to a message.

`serialized_event["content"]` could be set to the edit event's content, instead of a copy of it, which is bad as we attempt to modify it. Instead, we also end up modifying the original event's content. DINUM uses a third party rules module, which meant the event's content got frozen and thus an exception was raised.

To be clear, the problem is not that the event's content was frozen. In fact doing so helped us uncover the fact we weren't copying event content correctly.
2021-03-17 16:51:55 +00:00
..
_scripts Strip trailing / from server_url in register_new_matrix_user (#8823) 2020-11-26 10:57:26 +00:00
api Fix additional type hints from Twisted 21.2.0. (#9591) 2021-03-12 11:37:57 -05:00
app Enable flake8-bugbear, but disable most checks. (#9499) 2021-03-16 14:19:27 -04:00
appservice Add ResponseCache tests. (#9458) 2021-03-08 14:00:07 -05:00
config Enable flake8-bugbear, but disable most checks. (#9499) 2021-03-16 14:19:27 -04:00
crypto Enable flake8-bugbear, but disable most checks. (#9499) 2021-03-16 14:19:27 -04:00
events Ensure we use a copy of the event content dict before modifying it in serialize_event (#9585) 2021-03-17 16:51:55 +00:00
federation Don't go into federation catch up mode so easily (#9561) 2021-03-15 14:42:40 +00:00
groups Add type hints to groups code. (#9393) 2021-02-17 08:41:47 -05:00
handlers only save remote cross-signing keys if they're different from the current ones (#9634) 2021-03-17 11:04:57 -04:00
http Fix remaining mypy issues due to Twisted upgrade. (#9608) 2021-03-15 11:14:39 -04:00
logging Fix additional type hints from Twisted 21.2.0. (#9591) 2021-03-12 11:37:57 -05:00
metrics Fix additional type hints from Twisted upgrade. (#9518) 2021-03-03 15:47:38 -05:00
module_api Record the SSO Auth Provider in the login token (#9510) 2021-03-04 14:44:22 +00:00
push Fix additional type hints from Twisted 21.2.0. (#9591) 2021-03-12 11:37:57 -05:00
replication Fix up types for the typing handler. (#9638) 2021-03-17 11:30:21 -04:00
res/templates Support not providing an IdP icon when choosing a username. (#9440) 2021-02-19 07:48:46 -05:00
rest Fix up types for the typing handler. (#9638) 2021-03-17 11:30:21 -04:00
server_notices Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
spam_checker_api Combine SpamCheckerApi with the more generic ModuleApi. (#8464) 2020-10-07 12:03:26 +01:00
state Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
static Add initial support for a "pick your IdP" page (#9017) 2021-01-05 11:25:28 +00:00
storage Fix bad naming of storage function (#9637) 2021-03-17 13:20:08 +00:00
streams Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
util Add logging to ObservableDeferred callbacks (#9523) 2021-03-09 11:09:31 +00:00
__init__.py 1.30.0rc1 2021-03-16 13:45:46 +00:00
event_auth.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
notifier.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
python_dependencies.py Add a comment about systemd-python. (#9464) 2021-02-23 13:42:36 +00:00
secrets.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
server.py Fix up types for the typing handler. (#9638) 2021-03-17 11:30:21 -04:00
types.py Convert Requester to attrs (#9586) 2021-03-10 18:15:56 +00:00
visibility.py Merge pull request #9150 from Yoric/develop-context 2021-02-08 15:53:44 +01:00