Skip to content

fix(storage): clamp non-positive entry query limits to the maximum#4469

Merged
fguillot merged 1 commit into
mainfrom
fix/entry-query-limit-zero
Jul 21, 2026
Merged

fix(storage): clamp non-positive entry query limits to the maximum#4469
fguillot merged 1 commit into
mainfrom
fix/entry-query-limit-zero

Conversation

@fguillot

Copy link
Copy Markdown
Member

WithLimit ignored a zero limit, so /v1/entries?limit=0 produced a query without a SQL LIMIT and returned every matching entry, bypassing the 1000-entry cap. The official API client sends limit=0 for any filter with an unset Limit field, making unbounded queries easy to trigger.

Clamp non-positive values to the maximum in both WithLimit and WithLimitAndMaximum so every caller (REST API, Google Reader) stays bounded, as intended by 0909323.

WithLimit ignored a zero limit, so /v1/entries?limit=0 produced a query
without a SQL LIMIT and returned every matching entry, bypassing the
1000-entry cap. The official API client sends limit=0 for any filter
with an unset Limit field, making unbounded queries easy to trigger.

Clamp non-positive values to the maximum in both WithLimit and
WithLimitAndMaximum so every caller (REST API, Google Reader) stays
bounded, as intended by 0909323.
@fguillot
fguillot merged commit fbbff63 into main Jul 21, 2026
11 checks passed
@fguillot
fguillot deleted the fix/entry-query-limit-zero branch July 21, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant