mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-04-05 08:49:44 +00:00
matrix-synapse: support thread_subscriptions stream writers
Add `thread_subscriptions` as a supported web-facing stream writer in MDAD and route its unstable client endpoints via the same explicit writer-or-main model used for the other web-facing stream-backed APIs. This is not just another generic worker route. Current Synapse gives thread subscriptions their own `writers.thread_subscriptions` configuration, backs them with a multi-writer stream, and asserts on store writes that the current instance is an allowed thread-subscriptions writer. Explicit early routing is also required here because the subscription endpoint is room-scoped. In MDAD's specialized-worker model, the existing room-worker regex would otherwise match `/_matrix/client/unstable/io.element.msc4306/rooms/...` and steal the request before it reached the correct writer-or-main fallback. Unlike `device_lists`, support is added without enabling a thread-subscriptions worker by default in the standard presets. The underlying MSC4306/4308 feature remains unstable and disabled by default upstream, so the conservative default is to keep the worker count at `0` and let the new explicit routes fall back to `main` unless an operator opts in. Refs: -b99a58719b/synapse/config/workers.py (L175-L182)-b99a58719b/synapse/rest/client/thread_subscriptions.py (L38-L247)-b99a58719b/synapse/storage/databases/main/thread_subscriptions.py (L66-L83)-b99a58719b/synapse/storage/databases/main/thread_subscriptions.py (L192-L322)
This commit is contained in:
@@ -134,6 +134,12 @@ matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_en
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
|
||||
|
||||
# matrix_synapse_workers_stream_writer_thread_subscriptions_stream_worker_client_server_endpoints contains the endpoints serviced by the `thread_subscriptions` stream writer.
|
||||
# Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/thread_subscriptions.py#L38-L247
|
||||
matrix_synapse_workers_stream_writer_thread_subscriptions_stream_worker_client_server_endpoints:
|
||||
- ^/_matrix/client/unstable/io.element.msc4306/rooms/.*/thread/.*/subscription$
|
||||
- ^/_matrix/client/unstable/io.element.msc4308/thread_subscriptions$
|
||||
|
||||
# matrix_synapse_workers_user_dir_worker_client_server_endpoints contains the endpoints serviced by the `type = user_dir` (`app = generic_worker`) worker.
|
||||
# See: https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory
|
||||
matrix_synapse_workers_user_dir_worker_client_server_endpoints:
|
||||
@@ -142,11 +148,11 @@ matrix_synapse_workers_user_dir_worker_client_server_endpoints:
|
||||
# matrix_synapse_workers_known_stream_writer_stream_types contains the list of stream writer stream types that the playbook recognizes.
|
||||
# This is used for validation purposes. If adding support for a new type, besides adding it to this list,
|
||||
# don't forget to actually configure it where appropriate (see worker.yaml.j2`, the nginx proxy configuration, etc).
|
||||
matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists']
|
||||
matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists', 'thread_subscriptions']
|
||||
|
||||
# matrix_synapse_workers_webserving_stream_writer_types contains a list of stream writer types that serve web (client) requests.
|
||||
# Not all stream writers serve web requests. Some just perform background tasks.
|
||||
matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists']
|
||||
matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists', 'thread_subscriptions']
|
||||
|
||||
# matrix_synapse_workers_systemd_services_list contains a list of systemd services (one for each worker systemd service which serves web requests).
|
||||
# This list is built during runtime.
|
||||
@@ -310,6 +316,10 @@ matrix_synapse_workers_generic_worker_endpoints:
|
||||
# - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
|
||||
# - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
|
||||
#
|
||||
# # Thread subscriptions requests
|
||||
# - ^/_matrix/client/unstable/io.element.msc4306/rooms/.*/thread/.*/subscription$
|
||||
# - ^/_matrix/client/unstable/io.element.msc4308/thread_subscriptions$
|
||||
#
|
||||
# # User directory search requests
|
||||
# - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
|
||||
# End of intentionally-ignored-endpoints
|
||||
|
||||
Reference in New Issue
Block a user