0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-21 04:03:52 +01:00
synapse/tests/storage
Erik Johnston 5c9e39e619
Track device list updates per room. (#12321)
This is a first step in dealing with #7721.

The idea is basically that rather than calculating the full set of users a device list update needs to be sent to up front, we instead simply record the rooms the user was in at the time of the change. This will allow a few things:

1. we can defer calculating the set of remote servers that need to be poked about the change; and
2. during `/sync` and `/keys/changes` we can avoid also avoid calculating users who share rooms with other users, and instead just look at the rooms that have changed.

However, care needs to be taken to correctly handle server downgrades. As such this PR writes to both `device_lists_changes_in_room` and the `device_lists_outbound_pokes` table synchronously. In a future release we can then bump the database schema compat version to `69` and then we can assume that the new `device_lists_changes_in_room` exists and is handled.

There is a temporary option to disable writing to `device_lists_outbound_pokes` synchronously, allowing us to test the new code path does work (and by implication upgrading to a future release and downgrading to this one will work correctly).

Note: Ideally we'd do the calculation of room to servers on a worker (e.g. the background worker), but currently only master can write to the `device_list_outbound_pokes` table.
2022-04-04 15:25:20 +01:00
..
databases Add type hints for tests/unittest.py. (#12347) 2022-04-01 16:04:16 +00:00
__init__.py
test__base.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_account_data.py Use the ignored_users table to test event visibility & sync. (#12225) 2022-03-15 14:06:05 -04:00
test_appservice.py Add type hints for tests/unittest.py. (#12347) 2022-04-01 16:04:16 +00:00
test_background_update.py Add type hints to tests files. (#12256) 2022-03-21 09:43:16 -04:00
test_base.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_cleanup_extrems.py Default to private room visibility rather than public when a client does not specify one, according to spec. (#12350) 2022-04-01 15:55:09 +01:00
test_client_ips.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_database.py Handle cancellation in DatabasePool.runInteraction() (#12199) 2022-03-16 15:07:41 +00:00
test_devices.py Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
test_directory.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_e2e_room_keys.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_end_to_end_keys.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_event_chain.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_event_federation.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_event_metrics.py Fix (final) Bugbear violations (#9838) 2021-04-20 11:50:49 +01:00
test_event_push_actions.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_events.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_id_generators.py Remove redundant get_success calls in test code (#12346) 2022-04-01 16:10:31 +01:00
test_keys.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_main.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_monthly_active_users.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_profile.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_purge.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_redaction.py Remove redundant get_success calls in test code (#12346) 2022-04-01 16:10:31 +01:00
test_registration.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_rollback_worker.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_room.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_room_search.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_roommember.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_state.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_stream.py Remove redundant get_success calls in test code (#12346) 2022-04-01 16:10:31 +01:00
test_transactions.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
test_txn_limit.py Require direct references to configuration variables. (#10985) 2021-10-06 10:47:41 -04:00
test_unsafe_locale.py Refuse to start if DB has an unsafe locale (#12262) 2022-03-23 10:23:05 -07:00
test_user_directory.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00