synapse-product/synapse/handlers
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
..
ui_auth Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
account_data.py Add a module callback to react to account data changes (#12327) 2022-04-01 11:22:48 +02:00
account_validity.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
account.py Optionally include account validity in MSC3720 account status responses (#12266) 2022-03-24 11:19:41 +01:00
admin.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
appservice.py Send device list updates to application services (MSC3202) - part 1 (#11881) 2022-03-30 14:39:27 +01:00
auth.py Add a callback to react to 3PID associations (#12302) 2022-03-31 18:27:21 +02:00
cas.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
deactivate_account.py Add third_party module callbacks to check if a user can delete a room and deactivate a user (#12028) 2022-03-09 18:23:57 +00:00
device.py Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
devicemessage.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
directory.py Rename various ApplicationServices interested methods (#11915) 2022-03-03 18:14:09 +00:00
e2e_keys.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
e2e_room_keys.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
event_auth.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
events.py Use the proper serialization format when bundling aggregations. (#12090) 2022-03-03 10:43:06 -05:00
federation_event.py Optimise _get_state_after_missing_prev_event: use /state (#12040) 2022-04-01 12:53:42 +01:00
federation.py Return a 404 from /state for an outlier (#12087) 2022-03-21 11:23:32 +00:00
groups_local.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
identity.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
initial_sync.py Use ParamSpec in type hints for synapse.logging.context (#12150) 2022-03-08 15:58:14 +00:00
message.py Remove unused auth_event_ids argument plumbing (#12304) 2022-03-29 09:18:52 +01:00
oidc.py Implement a Jinja2 filter to extract localparts from email addresses (#12212) 2022-03-11 15:15:11 +00:00
pagination.py Move get_bundled_aggregations to relations handler. (#12237) 2022-03-18 17:49:32 +00:00
password_policy.py Use direct references for some configuration variables (part 3) (#10885) 2021-09-23 07:13:34 -04:00
presence.py Start application service stream token tracking from 1 (#12193) 2022-03-30 11:10:12 +00:00
profile.py Always allow the empty string as an avatar_url. (#12261) 2022-03-25 13:28:42 +00:00
read_marker.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
receipts.py Rename various ApplicationServices interested methods (#11915) 2022-03-03 18:14:09 +00:00
register.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
relations.py Remove an unnecessary class from the relations code. (#12338) 2022-03-31 07:13:49 -04:00
room_batch.py Refactor create_new_client_event to use a new parameter, state_event_ids, which accurately describes the usage with MSC2716 instead of abusing auth_event_ids (#12083) 2022-03-25 09:21:06 -05:00
room_list.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
room_member_worker.py Implement knock feature (#6739) 2021-06-09 19:39:51 +01:00
room_member.py Remove unused auth_event_ids argument plumbing (#12304) 2022-03-29 09:18:52 +01:00
room_summary.py Do not return allowed_room_ids from /hierarchy response. (#12175) 2022-03-08 08:09:11 -05:00
room.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
saml.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
search.py Move get_bundled_aggregations to relations handler. (#12237) 2022-03-18 17:49:32 +00:00
send_email.py Remove unnecessary ignores due to Twisted upgrade. (#11939) 2022-02-08 09:15:59 -05:00
set_password.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
sso.py Update the SSO username picker template to comply with SIWA guidelines (#12210) 2022-03-11 13:20:00 +00:00
state_deltas.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
stats.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
sync.py Send device list updates to application services (MSC3202) - part 1 (#11881) 2022-03-30 14:39:27 +01:00
typing.py Improve code documentation for the typing stream over replication. (#12211) 2022-03-11 14:00:15 +00:00
user_directory.py Correct check_username_for_spam annotations and docs (#12246) 2022-03-18 13:51:41 +00:00