Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit d2af652

Browse files
clokepMadLittleMods
andcommitted
Mark /relations endpoint as usable on workers. (#14028)
Co-authored-by: Eric Eastwood <erice@element.io>
1 parent b29ccf9 commit d2af652

File tree

6 files changed

+37
-2
lines changed

6 files changed

+37
-2
lines changed

changelog.d/14028.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The `/relations` endpoint can now be used on workers.

docker/complement/conf/start_for_complement.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ if [[ -n "$SYNAPSE_COMPLEMENT_USE_WORKERS" ]]; then
5757
federation_reader, \
5858
federation_sender, \
5959
synchrotron, \
60+
client_reader, \
6061
appservice, \
6162
pusher"
6263

docker/configure_workers_and_start.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,33 @@
107107
"shared_extra_conf": {},
108108
"worker_extra_conf": "",
109109
},
110+
"client_reader": {
111+
"app": "synapse.app.generic_worker",
112+
"listener_resources": ["client"],
113+
"endpoint_patterns": [
114+
"^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$",
115+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$",
116+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$",
117+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$",
118+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$",
119+
"^/_matrix/client/v1/rooms/.*/hierarchy$",
120+
"^/_matrix/client/(v1|unstable)/rooms/.*/relations/",
121+
"^/_matrix/client/(api/v1|r0|v3|unstable)/login$",
122+
"^/_matrix/client/(api/v1|r0|v3|unstable)/account/3pid$",
123+
"^/_matrix/client/(api/v1|r0|v3|unstable)/account/whoami$",
124+
"^/_matrix/client/versions$",
125+
"^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$",
126+
"^/_matrix/client/(r0|v3|unstable)/register$",
127+
"^/_matrix/client/(r0|v3|unstable)/auth/.*/fallback/web$",
128+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/messages$",
129+
"^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event",
130+
"^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms",
131+
"^/_matrix/client/(api/v1|r0|v3|unstable/.*)/rooms/.*/aliases",
132+
"^/_matrix/client/(api/v1|r0|v3|unstable)/search",
133+
],
134+
"shared_extra_conf": {},
135+
"worker_extra_conf": "",
136+
},
110137
"federation_reader": {
111138
"app": "synapse.app.generic_worker",
112139
"listener_resources": ["federation"],

docs/workers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ information.
203203
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
204204
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
205205
^/_matrix/client/v1/rooms/.*/hierarchy$
206+
^/_matrix/client/(v1|unstable)/rooms/.*/relations/
206207
^/_matrix/client/unstable/org.matrix.msc2716/rooms/.*/batch_send$
207208
^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
208209
^/_matrix/client/(r0|v3|unstable)/account/3pid$

scripts-dev/complement.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export COMPLEMENT_BASE_IMAGE=complement-synapse
126126

127127
extra_test_args=()
128128

129-
test_tags="synapse_blacklist,msc2716,msc3030,msc3787"
129+
test_tags="synapse_blacklist,msc3787"
130130

131131
# All environment variables starting with PASS_ will be shared.
132132
# (The prefix is stripped off before reaching the container.)
@@ -158,7 +158,10 @@ else
158158

159159
# We only test faster room joins on monoliths, because they are purposefully
160160
# being developed without worker support to start with.
161-
test_tags="$test_tags,faster_joins"
161+
#
162+
# The tests for importing historical messages (MSC2716) and jump to date (MSC3030)
163+
# also only pass with monoliths, currently.
164+
test_tags="$test_tags,faster_joins,msc2716,msc3030"
162165
fi
163166

164167

synapse/app/generic_worker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
push_rule,
6666
read_marker,
6767
receipts,
68+
relations,
6869
room,
6970
room_batch,
7071
room_keys,
@@ -308,6 +309,7 @@ def _listen_http(self, listener_config: ListenerConfig) -> None:
308309
sync.register_servlets(self, resource)
309310
events.register_servlets(self, resource)
310311
room.register_servlets(self, resource, is_worker=True)
312+
relations.register_servlets(self, resource)
311313
room.register_deprecated_servlets(self, resource)
312314
initial_sync.register_servlets(self, resource)
313315
room_batch.register_servlets(self, resource)

0 commit comments

Comments
 (0)