synapse-product/synapse
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
..
_scripts Merge branch 'master' into develop 2022-07-19 16:14:02 +02:00
api Allow rate limiters to passively record actions they cannot limit (#13253) 2022-07-13 19:09:42 +00:00
app Drop support for delegating email validation (#13192) 2022-07-12 19:18:53 +01:00
appservice Add prometheus counters for content types other than events (#13175) 2022-07-13 15:18:20 +01:00
config Merge branch 'master' into develop 2022-07-19 16:14:02 +02:00
crypto Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
events Don't pull out the full state when creating an event (#13281) 2022-07-18 10:05:30 +01:00
federation Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
handlers Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
http Validate federation destinations and log an error if server name is invalid. (#13318) 2022-07-20 11:17:26 -07:00
logging Add type annotations to trace decorator. (#13328) 2022-07-19 14:14:30 -04:00
metrics Fix Synapse git info missing in version strings (#12973) 2022-06-07 15:24:11 +01:00
module_api Uniformize spam-checker API, part 5: expand other spam-checker callbacks to return Tuple[Codes, dict] (#13044) 2022-07-11 16:52:10 +00:00
push Merge remote-tracking branch 'origin/master' into develop 2022-07-20 14:59:43 +01:00
replication Add type annotations to trace decorator. (#13328) 2022-07-19 14:14:30 -04:00
res Fix Jinja templating error when generating thumbnail URLs. (#12510) 2022-04-20 12:03:03 -04:00
rest Add type annotations to trace decorator. (#13328) 2022-07-19 14:14:30 -04:00
server_notices Decouple synapse.api.auth_blocking.AuthBlocking from synapse.api.auth.Auth. (#13021) 2022-06-14 09:51:15 +01:00
spam_checker_api Fix import in module_api module and docs on the new check_event_for_spam signature (#12918) 2022-05-31 12:04:53 +02:00
state Don't pull out the full state when creating an event (#13281) 2022-07-18 10:05:30 +01:00
static Display an error page during failure of fallback UIA. (#10561) 2021-08-18 08:13:35 -04:00
storage Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
streams Rework stream token to stop caring about groups. (#12897) 2022-05-31 07:42:50 -04:00
util Async get event cache prep (#13242) 2022-07-15 09:30:46 +00:00
__init__.py Fix Synapse git info missing in version strings (#12973) 2022-06-07 15:24:11 +01:00
event_auth.py Add support for room version 10 (#13220) 2022-07-13 11:36:02 -07:00
notifier.py Notifier: accept callbacks to fire on room joins (#13254) 2022-07-13 19:48:24 +01:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Move the "email unsubscribe" resource, refactor the macaroon generator & simplify the access token verification logic. (#12986) 2022-06-14 09:12:08 -04:00
types.py Fix destination_is errors seen in sentry. (#13041) 2022-06-14 18:28:26 +01:00
visibility.py Add a filter_event_for_clients_with_state function (#13222) 2022-07-11 14:14:09 +01:00