From 904736ef0fc84c5211e0904ca8d5b9aa69b7c529 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 17 Apr 2026 18:00:44 +0200 Subject: [PATCH 1/4] fix(client-server): Fix a typo in `/rooms/{roomId}/relations/{eventId}`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes a typo in `/rooms/{roomId}/relations/{eventId}`. The specification says about the `from` request query parameter: > The pagination token to start returning results from. If not supplied, > results start at the most recent topological event known to the > server. > > Can be a `next_batch` or `prev_batch` token from a previous call, > or a returned `start` token from `/messages`, or a `next_batch` token > from `/sync`. The last part is wrong. It should be: > … or a `prev_batch` token from `/sync`. Signed-off-by: Ivan Enderlin --- data/api/client-server/relations.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/api/client-server/relations.yaml b/data/api/client-server/relations.yaml index c59c5cb0..12078c20 100644 --- a/data/api/client-server/relations.yaml +++ b/data/api/client-server/relations.yaml @@ -254,7 +254,7 @@ components: Can be a `next_batch` or `prev_batch` token from a previous call, or a returned `start` token from [`/messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages), - or a `next_batch` token from [`/sync`](/client-server-api/#get_matrixclientv3sync). + or a `prev_batch` token from [`/sync`](/client-server-api/#get_matrixclientv3sync). required: false example: page2_token schema: From 619c667aa63798f8bc6e693a7ebf2f295600e5fb Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 17 Apr 2026 18:10:28 +0200 Subject: [PATCH 2/4] chore: Add #2357 in `changelogs/. --- changelogs/client_server/newsfragments/2357.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/2357.clarification diff --git a/changelogs/client_server/newsfragments/2357.clarification b/changelogs/client_server/newsfragments/2357.clarification new file mode 100644 index 00000000..c73a3ce8 --- /dev/null +++ b/changelogs/client_server/newsfragments/2357.clarification @@ -0,0 +1 @@ +The `prev_batch` token from `/sync` can be used as the `from` value in `GET /rooms/{roomId}/relations/{eventId}`. From f7c2b46cc303ed824dda43186d554bcda47ea9b9 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 May 2026 17:30:05 +0200 Subject: [PATCH 3/4] fixup! 904736e --- data/api/client-server/relations.yaml | 54 +++++++++++++++------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/data/api/client-server/relations.yaml b/data/api/client-server/relations.yaml index 12078c20..8388bc82 100644 --- a/data/api/client-server/relations.yaml +++ b/data/api/client-server/relations.yaml @@ -22,13 +22,13 @@ paths: description: |- Retrieve all of the child events for a given parent event. - Note that when paginating the `from` token should be "after" the `to` token in - terms of topological ordering, because it is only possible to paginate "backwards" - through events, starting at `from`. + Note that, in terms of topological ordering, the `from` token should be "after" + the `to` token when `dir=b`, and should be "before" the `to` token when `dir=f`. - For example, passing a `from` token from page 2 of the results, and a `to` token - from page 1, would return the empty set. The caller can use a `from` token from - page 1 and a `to` token from page 2 to paginate over the same range, however. + For example, with `dir=b`, passing a `from` token from page 2 of the results, and + a `to` token from page 1, would return the empty set. The caller can use a `from` + token from page 1 and a `to` token from page 2 to paginate over the same range, + however. operationId: getRelatingEvents security: - accessTokenQuery: [] @@ -80,13 +80,13 @@ paths: Retrieve all of the child events for a given parent event which relate to the parent using the given `relType`. - Note that when paginating the `from` token should be "after" the `to` token in - terms of topological ordering, because it is only possible to paginate "backwards" - through events, starting at `from`. + Note that, in terms of topological ordering, the `from` token should be "after" + the `to` token when `dir=b`, and should be "before" the `to` token when `dir=f`. - For example, passing a `from` token from page 2 of the results, and a `to` token - from page 1, would return the empty set. The caller can use a `from` token from - page 1 and a `to` token from page 2 to paginate over the same range, however. + For example, with `dir=b`, passing a `from` token from page 2 of the results, and + a `to` token from page 1, would return the empty set. The caller can use a `from` + token from page 1 and a `to` token from page 2 to paginate over the same range, + however. operationId: getRelatingEventsWithRelType security: - accessTokenQuery: [] @@ -142,13 +142,13 @@ paths: Retrieve all of the child events for a given parent event which relate to the parent using the given `relType` and have the given `eventType`. - Note that when paginating the `from` token should be "after" the `to` token in - terms of topological ordering, because it is only possible to paginate "backwards" - through events, starting at `from`. + Note that, in terms of topological ordering, the `from` token should be "after" + the `to` token when `dir=b`, and should be "before" the `to` token when `dir=f`. - For example, passing a `from` token from page 2 of the results, and a `to` token - from page 1, would return the empty set. The caller can use a `from` token from - page 1 and a `to` token from page 2 to paginate over the same range, however. + For example, with `dir=b`, passing a `from` token from page 2 of the results, and + a `to` token from page 1, would return the empty set. The caller can use a `from` + token from page 1 and a `to` token from page 2 to paginate over the same range, + however. operationId: getRelatingEventsWithRelTypeAndEventType security: - accessTokenQuery: [] @@ -252,9 +252,14 @@ components: The pagination token to start returning results from. If not supplied, results start at the most recent topological event known to the server. - Can be a `next_batch` or `prev_batch` token from a previous call, or a returned - `start` token from [`/messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages), - or a `prev_batch` token from [`/sync`](/client-server-api/#get_matrixclientv3sync). + If `dir=b`, then `from` can be `next_batch` from a previous call, or a + `prev_batch` token from a [`/sync`] or a `start` token from a [`/messages`]. + + If `dir=f`, then `from` can be `prev_batch` from a previous call, or a + `next_batch` token from a [`/sync`] or an `end` token from a [`/messages`]. + + [`/messages`]: /client-server-api/#get_matrixclientv3roomsroomidmessages + [`/sync`]: /client-server-api/#get_matrixclientv3sync required: false example: page2_token schema: @@ -266,8 +271,11 @@ components: The pagination token to stop returning results at. If not supplied, results continue up to `limit` or until there are no more events. - Like `from`, this can be a previous token from a prior call to this endpoint - or from `/messages` or `/sync`. + Like `from`, this can be a previous token from a prior call to this endpoint, + or from [`/sync`] or [`/messages`]. + + [`/messages`]: /client-server-api/#get_matrixclientv3roomsroomidmessages + [`/sync`]: /client-server-api/#get_matrixclientv3sync required: false example: page3_token schema: From a0cc3f30a98dbf3432610af572d4c732de7c2be1 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 May 2026 17:32:54 +0200 Subject: [PATCH 4/4] fixup! 619c667 --- changelogs/client_server/newsfragments/2357.clarification | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/client_server/newsfragments/2357.clarification b/changelogs/client_server/newsfragments/2357.clarification index c73a3ce8..f874c6cd 100644 --- a/changelogs/client_server/newsfragments/2357.clarification +++ b/changelogs/client_server/newsfragments/2357.clarification @@ -1 +1 @@ -The `prev_batch` token from `/sync` can be used as the `from` value in `GET /rooms/{roomId}/relations/{eventId}`. +Clarify which tokens can be used in `from` or `to` in `GET /rooms/{roomId}/relations/{eventId}`.