diff options
author | Eric Eastwood <erice@element.io> | 2022-07-20 15:58:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 15:58:51 -0500 |
commit | 0f971ca68e808dd16f53f5594a6b33b7bddcc9a9 (patch) | |
tree | 07e68c0a7bc2d05cc6f6ac2e8905d069bff40872 /changelog.d | |
parent | Validate federation destinations and log an error if server name is invalid. ... (diff) | |
download | synapse-0f971ca68e808dd16f53f5594a6b33b7bddcc9a9.tar.xz |
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`](https://github.com/matrix-org/synapse/blob/7864f33e286dec22368dc0b11c06eebb1462a51e/synapse/federation/federation_client.py#L581-L594).
Diffstat (limited to 'changelog.d')
-rw-r--r-- | changelog.d/13320.misc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog.d/13320.misc b/changelog.d/13320.misc new file mode 100644 index 0000000000..d33cf3a25a --- /dev/null +++ b/changelog.d/13320.misc @@ -0,0 +1 @@ +Fix `FederationClient.get_pdu()` returning events from the cache as `outliers` instead of original events we saw over federation. |