Skip to content

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

Merged
christophebrun-forest merged 1 commit into
mainfrom
fix/zendesk-max-total-results
May 13, 2026
Merged

fix(zendesk): raise ForestException past Zendesk Search 1000-result cap#299
christophebrun-forest merged 1 commit into
mainfrom
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>
Copy link
Copy Markdown
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christophebrun-forest christophebrun-forest merged commit d73cc13 into main May 13, 2026
40 checks passed
@christophebrun-forest christophebrun-forest deleted the fix/zendesk-max-total-results branch May 13, 2026 15:16
forest-bot added a commit that referenced this pull request May 13, 2026
## [1.29.2](v1.29.1...v1.29.2) (2026-05-13)

### Bug Fixes

* **zendesk:** raise ForestException past Zendesk Search 1000-result cap ([#299](#299)) ([d73cc13](d73cc13))
@forest-bot
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.29.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants