From 516fd891eeb3cade255298a2239ca607bfbec16a Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Fri, 26 Apr 2024 17:46:42 +0900 Subject: [PATCH] Use recommended endpoint for MSC3266 requests (#17078) Keep the existing endpoint for backwards compatibility Signed-off-by: Andrew Ferrazzutti --- changelog.d/17078.bugfix | 1 + docs/workers.md | 2 +- synapse/rest/client/room.py | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog.d/17078.bugfix diff --git a/changelog.d/17078.bugfix b/changelog.d/17078.bugfix new file mode 100644 index 0000000000..286a772a1e --- /dev/null +++ b/changelog.d/17078.bugfix @@ -0,0 +1 @@ +For MSC3266 room summaries, support queries at the recommended endpoint of `/_matrix/client/unstable/im.nheko.summary/summary/{roomIdOrAlias}`. The existing endpoint of `/_matrix/client/unstable/im.nheko.summary/rooms/{roomIdOrAlias}/summary` is deprecated. diff --git a/docs/workers.md b/docs/workers.md index ab9c1db86b..9a0cc9f2f4 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -232,7 +232,7 @@ information. ^/_matrix/client/v1/rooms/.*/hierarchy$ ^/_matrix/client/(v1|unstable)/rooms/.*/relations/ ^/_matrix/client/v1/rooms/.*/threads$ - ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$ + ^/_matrix/client/unstable/im.nheko.summary/summary/.*$ ^/_matrix/client/(r0|v3|unstable)/account/3pid$ ^/_matrix/client/(r0|v3|unstable)/account/whoami$ ^/_matrix/client/(r0|v3|unstable)/devices$ diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py index e4c7dd1a58..fb4d44211e 100644 --- a/synapse/rest/client/room.py +++ b/synapse/rest/client/room.py @@ -1442,10 +1442,16 @@ class RoomHierarchyRestServlet(RestServlet): class RoomSummaryRestServlet(ResolveRoomIdMixin, RestServlet): PATTERNS = ( + # deprecated endpoint, to be removed re.compile( "^/_matrix/client/unstable/im.nheko.summary" "/rooms/(?P[^/]*)/summary$" ), + # recommended endpoint + re.compile( + "^/_matrix/client/unstable/im.nheko.summary" + "/summary/(?P[^/]*)$" + ), ) CATEGORY = "Client API requests"