anonymousland-synapse/synapse/storage
Eric Eastwood 0f971ca68e
Update get_pdu to return the original, pristine EventBase (#13320)
Update `get_pdu` to return the untouched, pristine `EventBase` as it was originally seen over federation (no metadata added). Previously, we returned the same `event` reference that we stored in the cache which downstream code modified in place and added metadata like setting it as an `outlier`  and essentially poisoned our cache. Now we always return a copy of the `event` so the original can stay pristine in our cache and re-used for the next cache call.

Split out from https://github.com/matrix-org/synapse/pull/13205

As discussed at:

 - https://github.com/matrix-org/synapse/pull/13205#discussion_r918365746
 - https://github.com/matrix-org/synapse/pull/13205#discussion_r918366125

Related to https://github.com/matrix-org/synapse/issues/12584. This PR doesn't fix that issue because it hits [`get_event` which exists from the local database before it tries to `get_pdu`](7864f33e28/synapse/federation/federation_client.py (L581-L594)).
2022-07-20 15:58:51 -05:00
..
controllers Don't pull out the full state when storing state (#13274) 2022-07-15 12:59:45 +00:00
databases Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
engines Use dummy fallback engines if imports fail (#12979) 2022-06-07 17:33:55 +01:00
schema Bg update to populate new events table columns (#13215) 2022-07-15 12:47:26 +01:00
util Log the stack when waiting for an entire room to be un-partial stated (#13257) 2022-07-12 18:57:38 +01:00
__init__.py Rename storage classes (#12913) 2022-05-31 12:17:50 +00:00
_base.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
background_updates.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
database.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
keys.py Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
prepare_database.py Use dummy fallback engines if imports fail (#12979) 2022-06-07 17:33:55 +01:00
push_rule.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
roommember.py Do not include rooms with an unknown room version in a sync response. (#10644) 2021-08-19 11:12:55 -04:00
state.py Faster joins: add issue links to the TODOs (#13004) 2022-06-09 10:13:03 +00:00
types.py Tidy up and type-hint the database engine modules (#12734) 2022-05-17 00:34:38 +01:00