synapse/tests/rest/client/v2_alpha
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
..
__init__.py Refactor REST API tests to use explicit reactors (#3351) 2018-07-17 20:43:18 +10:00
test_account.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_auth.py SSO: redirect to public URL before setting cookies (#9436) 2021-02-26 14:02:06 +00:00
test_capabilities.py Return m.change_password.enabled=false if local database is disabled (#9588) 2021-03-16 11:44:25 -04:00
test_filter.py Remove spurious "SynapseRequest" result from `make_request" 2020-12-15 22:35:40 +00:00
test_password_policy.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_register.py Remove spurious "SynapseRequest" result from `make_request" 2020-12-15 22:35:40 +00:00
test_relations.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
test_shared_rooms.py Remove cache for get_shared_rooms_for_users (#9416) 2021-02-22 16:52:45 +00:00
test_sync.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_upgrade_room.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00