anonymousland-synapse/synapse
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
..
_scripts Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
api Bump black and click versions (#12320) 2022-03-29 10:41:19 +00:00
app Move update_client_ip background job from the main process to the background worker. (#12251) 2022-04-01 13:08:55 +01:00
appservice Send device list updates to application services (MSC3202) - part 1 (#11881) 2022-03-30 14:39:27 +01:00
config Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
crypto Fix typechecker problems exposed by signedjson 1.1.2 (#12326) 2022-03-29 21:37:50 +00:00
events Add a callback to react to 3PID associations (#12302) 2022-03-31 18:27:21 +02:00
federation Enhance logging for inbound federation events (#12301) 2022-03-25 14:44:57 +00:00
groups Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
handlers Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
http Bump black and click versions (#12320) 2022-03-29 10:41:19 +00:00
logging Use ParamSpec in type hints for synapse.logging.context (#12150) 2022-03-08 15:58:14 +00:00
metrics Use version string helper from matrix-common (#11979) 2022-02-14 13:12:22 +00:00
module_api Add a module callback to react to account data changes (#12327) 2022-04-01 11:22:48 +02:00
push Un-revert Jinja2 fix (#12313) 2022-03-28 17:02:57 +00:00
replication Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
res Tweak copy for sso account details template (#12265) 2022-03-22 10:22:25 +00:00
rest Move MSC2654 support behind an experimental configuration flag. (#12295) 2022-03-31 15:05:13 -04:00
server_notices Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
spam_checker_api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state Fix type of events in StateGroupStorage and StateHandler (#12156) 2022-03-04 10:25:18 +00:00
static Display an error page during failure of fallback UIA. (#10561) 2021-08-18 08:13:35 -04:00
storage Track device list updates per room. (#12321) 2022-04-04 15:25:20 +01:00
streams Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
util Add more type hints to the main state store. (#12267) 2022-03-31 13:38:09 -04:00
__init__.py 1.55.2 2022-03-24 19:13:20 +00:00
event_auth.py Remove excess condition on knock->leave check (#11900) 2022-02-22 18:35:01 +00:00
notifier.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00: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
python_dependencies.py Un-revert Jinja2 fix (#12313) 2022-03-28 17:02:57 +00:00
server.py Add a relations handler to avoid duplication. (#12227) 2022-03-16 10:39:15 -04:00
types.py Send device list updates to application services (MSC3202) - part 1 (#11881) 2022-03-30 14:39:27 +01:00
visibility.py Handle outliers in /federation/v1/event (#12332) 2022-03-31 17:39:34 +00:00