From f3ab533374850285360cf5aa0ef61350c5229307 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 21 Jun 2019 10:43:12 +0100 Subject: [PATCH 1/3] Support pagination API in client_reader worker --- docs/workers.rst | 7 +++++++ synapse/app/client_reader.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/docs/workers.rst b/docs/workers.rst index aa4e7a120..5b08fd7ee 100644 --- a/docs/workers.rst +++ b/docs/workers.rst @@ -239,6 +239,13 @@ be routed to the same instance:: ^/_matrix/client/(r0|unstable)/register$ +Pagination requests can also be handled, but all requests with the same path +room must be routed to the same instance. Additionally, care must be taken to +ensure that the purge history admin API is not used while pagination requests +for the room are not in flight:: + + ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/messages$ + ``synapse.app.user_dir`` ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/synapse/app/client_reader.py b/synapse/app/client_reader.py index 310cdab2e..fb8220676 100644 --- a/synapse/app/client_reader.py +++ b/synapse/app/client_reader.py @@ -52,6 +52,7 @@ from synapse.rest.client.v1.room import ( PublicRoomListRestServlet, RoomEventContextServlet, RoomMemberListRestServlet, + RoomMessageListRestServlet, RoomStateRestServlet, ) from synapse.rest.client.v1.voip import VoipRestServlet @@ -109,6 +110,7 @@ class ClientReaderServer(HomeServer): JoinedRoomMemberListRestServlet(self).register(resource) RoomStateRestServlet(self).register(resource) RoomEventContextServlet(self).register(resource) + RoomMessageListRestServlet(self).register(resource) RegisterRestServlet(self).register(resource) LoginRestServlet(self).register(resource) ThreepidRestServlet(self).register(resource) From 626a26dbb80eabfb246cd0092e7deaa5d8c0d10f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 21 Jun 2019 10:46:11 +0100 Subject: [PATCH 2/3] Newsfile --- changelog.d/5505.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5505.feature diff --git a/changelog.d/5505.feature b/changelog.d/5505.feature new file mode 100644 index 000000000..5c6bab2c3 --- /dev/null +++ b/changelog.d/5505.feature @@ -0,0 +1 @@ +Add support for handling pagination APIs on client reader worker. From 60b912cf0d6e4c54455e2db0c994e52a53051ea3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 21 Jun 2019 11:54:03 +0100 Subject: [PATCH 3/3] Update docs/workers.rst E_TOO_MANY_NEGATIVES Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- docs/workers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workers.rst b/docs/workers.rst index 5b08fd7ee..7b2d2db53 100644 --- a/docs/workers.rst +++ b/docs/workers.rst @@ -242,7 +242,7 @@ be routed to the same instance:: Pagination requests can also be handled, but all requests with the same path room must be routed to the same instance. Additionally, care must be taken to ensure that the purge history admin API is not used while pagination requests -for the room are not in flight:: +for the room are in flight:: ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/messages$