Allow cursor-based pagination to query extra page until collection is empty#4195
Open
nogates wants to merge 1 commit into
Open
Allow cursor-based pagination to query extra page until collection is empty#4195nogates wants to merge 1 commit into
nogates wants to merge 1 commit into
Conversation
… empty Mirrors datadog-api-client-java#3790 and datadog-api-client-go#3769 for the TypeScript client. Cursor-based paginators now keep querying until the response collection is empty, instead of stopping early when a page returns fewer items than the requested limit. Page-offset and page-number paginations keep their existing behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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.
What does this PR do?
Mirrors datadog-api-client-java#3790 and datadog-api-client-go#3769 for the TypeScript client.
Cursor-based paginators now keep querying until the response collection is empty (
results.length === 0), instead of stopping early when a page returns fewer items than the requested limit (results.length < pageSize). This prevents missed items when a page happens to return fewer results than the limit without being the last page. Page-offset and page-number paginations keep their existing behavior.WithPaginationmethods updated across 13 v2 API files (Audit, CI Visibility Pipelines/Tests, Container Images, Containers, Events, Logs, Metrics, Processes, RUM, Security Monitoring, Spans, Test Optimization).ListSecurityFindingsandSearchSecurityFindingspagination tests.Additional Notes
The supporting cassettes (extra trailing
{"data":[]}response) for most cursor-based endpoints were already added previously. Only the two Security Findings cassettes needed new empty-response entries.Review checklist
Please check relevant items below:
This PR includes all newly recorded cassettes for any modified tests.
This PR does not rely on API client schema changes.
Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.
🤖 Generated with Claude Code