Skip to content

fix(zendesk): raise ForestException past Zendesk Search 1000-result cap#299

Open
christophebrun-forest wants to merge 1 commit intomainfrom
fix/zendesk-max-total-results
Open

fix(zendesk): raise ForestException past Zendesk Search 1000-result cap#299
christophebrun-forest wants to merge 1 commit intomainfrom
fix/zendesk-max-total-results

Conversation

@christophebrun-forest
Copy link
Copy Markdown
Member

@christophebrun-forest christophebrun-forest commented May 6, 2026

Zendesk Search caps total results at 1000 in addition to the per-page max of 100 already handled via Client::MAX_PER_PAGE. translate_page previously computed page numbers without bounds, so paginating past offset 1000 sent page=11 to Zendesk and surfaced an opaque APIError.

Add Client::MAX_TOTAL_RESULTS = 1000 and refuse the request before sending when (page_num * per_page) would exceed it. The exception points the user at the actionable next step (narrow the filter) instead of a generic 422 wrapper.

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Raise ForestException when Zendesk search pagination exceeds 1000-result cap

Zendesk's Search API caps results at 1000. BaseCollection#translate_page now raises a ForestException with an actionable message advising the user to narrow their filter when the requested page offset would exceed this limit. A new Client::MAX_TOTAL_RESULTS constant (1000) centralizes the threshold.

Macroscope summarized 3d008df.

Zendesk Search caps total results at 1000 in addition to the per-page
max of 100 already handled via Client::MAX_PER_PAGE. translate_page
previously computed page numbers without bounds, so paginating past
offset 1000 sent page=11 to Zendesk and surfaced an opaque APIError.

Add Client::MAX_TOTAL_RESULTS = 1000 and refuse the request before
sending when (page_num * per_page) would exceed it. The exception
points the user at the actionable next step (narrow the filter)
instead of a generic 422 wrapper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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