Skip to content

Commit d5bcd30

Browse files
committed
chore(changeset): metadata-protocol patch for the offset total
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pNK9fm2KtGj8ijVqC
1 parent 4cd19ec commit d5bcd30

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): an offset with no limit reports the filtered total
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A Data API list read that skipped rows without naming a page size reported a wrong `total`: the number of matching rows minus the offset. `GET /api/v1/data/OBJECT?$skip=3&$count=true` over 14 rows answered `total: 11`, while the same query with `$top=100` answered 14, and `POST /api/v1/data/OBJECT/query` with `{"offset":999,"count":true}` answered `total: 0`. `total` is now the number of rows matching the filter whatever the offset, as it already was when a limit was present.
11+
12+
Such a request now runs the same count a paged request runs, over the same filter and search. `$count=false` with an offset issues no count and omits `total`, as it does with a limit. A read with neither an offset nor a limit is unchanged and issues no count.
13+
14+
What to do: nothing. A client that pages with `$skip` (or `offset`) alone now reads the true total.

0 commit comments

Comments
 (0)