Skip to content

Send page size as limit, the parameter the API actually reads - #1

Merged
partouf merged 1 commit into
mainfrom
fix/pagination-limit-param
Nov 16, 2026
Merged

partouf merged 1 commit into
mainfrom
fix/pagination-limit-param

Conversation

@partouf

@partouf partouf commented Sep 7, 2026

Copy link
Copy Markdown
Member

The bug

The API reads the page-size query parameter as limit — applicationListQuerySchema in bindist-terraform/src/shared/utils/validation.ts, default 20, max 100 — and parseListQuery only ever looks at params.limit. The string pageSize appears nowhere in the server source.

This client sent pageSize. The server discarded it and fell back to the default, so every paged request returned 20 rows no matter what the caller asked for, and nothing surfaced an error to say the requested size had been dropped.

The fix

Send limit on the wire.

The public option keeps its existing name, so this is not a breaking change for callers — only the query string differs. A doc comment on the field records that the option name and the parameter name differ deliberately, so the next reader doesn't "correct" it back.

Scope

Found while auditing the pagination contract across all six clients. Five of them sent pageSize; the Rust client already sent limit and was treated as the reference. Companion PRs go to the Go, Python, JavaScript and Delphi clients; the (as yet unpublished) .NET client is fixed locally.

Two related server-side gaps found in the same pass, not addressed here:

  • GET /v1/activity accepts limit only (default 50, max 100) — there is no page parameter, though some clients send one.
  • GET /v1/management/customers parses no query parameters at all and returns every customer, despite client signatures that promise pagination.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GkhmPJLKvghmHZ5avEVQeN

Verification

npm run lint, npm run typecheck and npm run build pass locally; CI green on this branch.

The server parses the page-size query parameter as `limit`
(applicationListQuerySchema in bindist-terraform's validation.ts; default
20, max 100) and never looks at `pageSize`. Every request this client sent
was therefore silently capped at the default 20 rows, with no error to
indicate the requested size had been discarded.

The public option keeps its existing name so callers are unaffected; only
the wire parameter changes. A doc comment on the field records that the
two names differ on purpose.

The Rust client already sent `limit` and is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GkhmPJLKvghmHZ5avEVQeN
@partouf
partouf merged commit f0678bf into main Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant