0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-14 22:11:47 +01:00
synapse/tests/rest/client
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
..
v1 Add support for stable MSC2858 API (#9617) 2021-03-16 11:21:26 +00:00
v2_alpha 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
__init__.py copyrights 2016-01-07 04:26:29 +00:00
test_consent.py Remove spurious "SynapseRequest" result from `make_request" 2020-12-15 22:35:40 +00:00
test_ephemeral_message.py Remove spurious "SynapseRequest" result from `make_request" 2020-12-15 22:35:40 +00:00
test_identity.py Remove spurious "SynapseRequest" result from `make_request" 2020-12-15 22:35:40 +00:00
test_power_levels.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_redactions.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_retention.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_shadow_banned.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_third_party_rules.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_transactions.py Clean up some LoggingContext stuff (#7120) 2020-03-24 14:45:33 +00:00