synapse-product/synapse/federation
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
..
sender Federation Sender & Appservice Pusher Stream Optimisations (#13251) 2022-07-15 09:36:56 +01:00
transport Add type annotations to trace decorator. (#13328) 2022-07-19 14:14:30 -04:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
federation_base.py Reduce the amount of state we pull from the DB (#12811) 2022-06-06 09:24:12 +01:00
federation_client.py Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
federation_server.py Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00
persistence.py Remove log_function and its uses (#11761) 2022-01-18 13:06:04 +00:00
send_queue.py Spread out sending device lists to remote hosts (#12132) 2022-03-04 11:48:15 +00:00
units.py Convert Transaction and Edu object to attrs (#10542) 2021-08-06 09:39:59 -04:00