synapse-product/tests
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
..
api Allow rate limiters to passively record actions they cannot limit (#13253) 2022-07-13 19:09:42 +00:00
app Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
appservice Remove remaining bits of groups code. (#12936) 2022-06-01 09:41:25 -04:00
config Reload cache factors from disk on SIGHUP (#12673) 2022-05-11 13:43:22 +00:00
crypto Remove direct refeferences to PyNaCl (use signedjson instead). (#12902) 2022-06-01 07:32:35 -04:00
events Rename storage classes (#12913) 2022-05-31 12:17:50 +00:00
federation Update get_pdu to return the original, pristine EventBase (#13320) 2022-07-20 15:58:51 -05:00
handlers Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00
http Fix destination_is errors seen in sentry. (#13041) 2022-06-14 18:28:26 +01:00
logging More type hints for synapse.logging (#13103) 2022-06-30 13:05:06 +00:00
module_api Additional constants for EDU types. (#12884) 2022-05-27 07:14:36 -04:00
push Don't include appservice users when calculating push rules (#13332) 2022-07-20 12:06:13 +01:00
replication Speed up get_unread_event_push_actions_by_room (#13005) 2022-06-15 15:17:14 +00:00
rest Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00
scripts Add some type hints to tests files (#12833) 2022-05-23 11:23:26 +00:00
server_notices Decouple synapse.api.auth_blocking.AuthBlocking from synapse.api.auth.Auth. (#13021) 2022-06-14 09:51:15 +01:00
state Fix typechecks against twisted trunk (#13061) 2022-06-15 11:49:58 +01:00
storage Use a real room in the notification rotation tests. (#13260) 2022-07-15 08:22:43 -04:00
test_utils Rename storage classes (#12913) 2022-05-31 12:17:50 +00:00
util Move the "email unsubscribe" resource, refactor the macaroon generator & simplify the access token verification logic. (#12986) 2022-06-14 09:12:08 -04:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
server.py annotate tests.server.FakeChannel (#13136) 2022-07-04 18:08:56 +01:00
test_distributor.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_event_auth.py Add support for room version 10 (#13220) 2022-07-13 11:36:02 -07:00
test_federation.py Rip out auth-event reconciliation code (#12943) 2022-07-14 21:52:26 +00:00
test_mau.py Remove remaining bits of groups code. (#12936) 2022-06-01 09:41:25 -04:00
test_metrics.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_phone_home.py Add type hints to some tests files (#12371) 2022-04-05 13:54:41 +01:00
test_server.py Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00
test_state.py Don't pull out the full state when storing state (#13274) 2022-07-15 12:59:45 +00:00
test_terms_auth.py Remove unnecessary json.dumps from tests (#13303) 2022-07-17 22:28:45 +01:00
test_test_utils.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_types.py Fix destination_is errors seen in sentry. (#13041) 2022-06-14 18:28:26 +01:00
test_visibility.py Rename test case method to add_hashes_and_signatures_from_other_server (#13255) 2022-07-12 18:46:32 +00:00
unittest.py Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00
utils.py Rate limit joins per-room (#13276) 2022-07-19 11:45:17 +00:00