bug: Cannot paginate beyond some arbitrary event in some remote rooms #2418

Open
opened 2026-10-27 07:47:57 +00:00 by catcraft · 0 comments

What is the bug?

In some remote rooms, I cannot paginate past some random event in the room. When I try (in /messages), I get response with an empty chunk and no end token:

{"start":"-56129501","chunk":[]}

Steps to reproduce

Repeatedly paginate using /messages until the end token is not returned. Some JS code to replicate:

const baseUrl = 'https://matrix.example.com';
const roomId = '!1234';
const accessToken = 'AbcDeFGhIJK';
let paginationToken = undefined;
let responseJson = undefined;
do {
  const query = new URLSearchParams([['dir', 'b'], ['limit', '1000']]);
  if (paginationToken) query.set('from', paginationToken);
  const response = await fetch(`${baseUrl}/_matrix/client/v3/rooms/${roomId}/messages?${query.toString()}`,
    {
      'headers': {
        'accept': 'application/json',
        'authorization': `Bearer ${accessToken}`,
      },
      'method': 'GET',
    }
  );
  responseJson = await response.json();
  paginationToken = responseJson.end;
} while (paginationToken);
console.log(responseJson);

The result is almost identical to the response example given above.

Server name and version

scav.dev continuwuity 26.9.1 (046074b)

Additional context

Attached server logs for completeness but I don't think there's anything relevant in there. Nothing happens in the logs when I encounter the bug. My continuwuity instance is running in Docker/k8s, so I couldn't get debug logs.

### What is the bug? In some remote rooms, I cannot paginate past some random event in the room. When I try (in `/messages`), I get response with an empty chunk and no `end` token: ``` {"start":"-56129501","chunk":[]} ``` ### Steps to reproduce Repeatedly paginate using `/messages` until the `end` token is not returned. Some JS code to replicate: ```javascript const baseUrl = 'https://matrix.example.com'; const roomId = '!1234'; const accessToken = 'AbcDeFGhIJK'; let paginationToken = undefined; let responseJson = undefined; do { const query = new URLSearchParams([['dir', 'b'], ['limit', '1000']]); if (paginationToken) query.set('from', paginationToken); const response = await fetch(`${baseUrl}/_matrix/client/v3/rooms/${roomId}/messages?${query.toString()}`, { 'headers': { 'accept': 'application/json', 'authorization': `Bearer ${accessToken}`, }, 'method': 'GET', } ); responseJson = await response.json(); paginationToken = responseJson.end; } while (paginationToken); console.log(responseJson); ``` The result is almost identical to the response example given above. ### Server name and version scav.dev continuwuity 26.9.1 (046074b) ### Additional context Attached server logs for completeness but I don't think there's anything relevant in there. Nothing happens in the logs when I encounter the bug. My continuwuity instance is running in Docker/k8s, so I couldn't get debug logs.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2418
No description provided.