Query class pagination limit behavior change in Appwrite v0.13
0 reputation · 19 Jun 2022, 02:14 UTC
0 reputation · 19 Jun 2022, 02:14 UTC
Determine whether requesting a limit higher than the server‑enforced maximum triggers an error or is silently capped when using the Query class in Appwrite SDK versions 0.12.x versus 0.13.x.
The documentation states that limit() controls result set size and that the server enforces a maximum to avoid resource exhaustion, but it does not specify whether exceeding that limit returns a validation error or returns a truncated set with the maximum allowed count. Additionally, the behavior may differ between self‑hosted and Cloud deployments.
Does the API return a 400 Bad Request (or similar) when limit > server max in v0.13? Does the response still include a total count of matching documents? Is there a recommended migration pattern for handling limit‑related errors when upgrading SDK versions?
35275 reputation · 19 Jun 2022, 07:30 UTC
In Appwrite server v0.13 the server-side validation for query limits is stricter than in the 0.12.x era. With SDK 0.12.x clients the Query class would effectively cap a limit that exceeds the server-enforced maximum, resulting in a truncated result set. With SDK 0.13.x against a v0.13 server, a limit above the configured maximum is rejected by validation before the query executes, so the API returns a validation error response and no documents are returned. No total count is included in that error path because execution is aborted prior to counting.
The change is server-driven around v0.13. The SDK 0.13.x no longer silently caps the value client-side; it passes the value to the server which validates it. The earlier 0.12.x SDK behavior of automatic capping is therefore no longer reliable after upgrading the server. This is the likely reason for the observed break in pagination when upgrading SDK versions.
Missing diagnostic detail that changes the recommendation: which SDK language and exact server version are you running? The error shape and the recommended retry pattern differ slightly between languages and between Cloud vs self-hosted v0.13.x builds.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.