anonymousland-synapse/tests
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
..
api
app
appservice
config
crypto
events
federation Don't go into federation catch up mode so easily (#9561) 2021-03-15 14:42:40 +00:00
handlers Add SSO attribute requirements for OIDC providers (#9609) 2021-03-16 11:46:07 -04:00
http Add tests for blacklisting reactor/agent. (#9563) 2021-03-11 09:15:22 -05:00
logging
module_api
push
replication Fix remaining mypy issues due to Twisted upgrade. (#9608) 2021-03-15 11:14:39 -04:00
rest 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
scripts
server_notices
state
storage Use the chain cover index in get_auth_chain_ids. (#9576) 2021-03-10 09:57:59 -05:00
test_utils Fix additional type hints. (#9543) 2021-03-09 07:41:32 -05:00
util Add ResponseCache tests. (#9458) 2021-03-08 14:00:07 -05:00
__init__.py
server.py Fix remaining mypy issues due to Twisted upgrade. (#9608) 2021-03-15 11:14:39 -04:00
test_distributor.py
test_event_auth.py
test_federation.py
test_mau.py
test_metrics.py
test_phone_home.py
test_preview.py
test_server.py
test_state.py
test_terms_auth.py
test_test_utils.py
test_types.py
test_visibility.py
unittest.py 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
utils.py