fix(zendesk-api): handle pagination limit error gracefully for getTags#295
Merged
cuneytcelebican merged 5 commits intoMay 11, 2026
Merged
Conversation
Fixes SCLABS-2911 **Problem:** When customers have 10,000+ tags, the getTags() method crashes when hitting Zendesk's pagination limit (page 100 / 10,000 records max). This blocks tag-based audience segmentation in Relay app. **Solution:** - Add error handling in fetchAllPaginatedResults() to catch InvalidPaginationDepth errors - Stop fetching gracefully at pagination limit instead of crashing - Return partial results (first ~10,000 tags) with console warning - Include endpoint URL in warning message for debugging **Testing:** - Added test for graceful pagination limit handling - Added test to verify non-pagination errors are still thrown - All existing tests pass Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add eslint-disable-next-line for console.warn statement - Fix prettier formatting in test expectations Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Vico1993
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes SCLABS-2911 - Tags fail to load for customers with 10k+ tags
Problem
When customers have 10,000+ tags (e.g., bukabantuan.zendesk.com), the
getTags()method crashes when hitting Zendesk's pagination limit. The API returns a 400 error at page 101:This blocks tag-based audience segmentation in the Relay app, preventing a core feature from working.
Solution
Added error handling in
fetchAllPaginatedResults()to:InvalidPaginationDeptherrors from Zendesk APIChanges
Testing
✅ All 151 tests pass
✅ New test: pagination limit error handling
✅ New test: non-pagination errors still thrown
✅ No regressions in existing functionality
✅ 98.69% code coverage maintained
Impact
Acceptance Criteria
Notes
The next phase (free-text tag entry in the UI) is tracked separately as it requires changes in the consuming application, not this library.
🤖 Generated with Claude Code