Set cursor totalItemsMode to exclude with explanatory comment

Cursor requests already carry the computed totalItems from page 1,
so the count query is skipped regardless of this value. Setting it
to 'exclude' reflects what actually happens, and the comment
explains why the value doesn't matter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-05-21 16:38:37 +02:00
parent 4cc7231379
commit 2139bf53d1
@@ -870,7 +870,9 @@ function parseCursorFromRequest(
if (isQueryEntitiesCursorRequest(request)) {
return {
...request.cursor,
totalItemsMode: 'include',
// Doesn't matter — cursor already carries the computed totalItems
// number from the first page, so the count query is skipped regardless.
totalItemsMode: 'exclude',
};
}
return {