Skip to content

fix: advance pagination with cursors - #499

Merged
David-patrick-chuks-02 merged 4 commits into
Lilly-Protocol:mainfrom
Aming9303:fix/403-cursor-pagination
Sep 6, 2026
Merged

fix: advance pagination with cursors#499
David-patrick-chuks-02 merged 4 commits into
Lilly-Protocol:mainfrom
Aming9303:fix/403-cursor-pagination

Conversation

@Aming9303

@Aming9303 Aming9303 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make paginate consume cursor metadata and pass each returned cursor into the next request
  • preserve the existing one-page array response API while adding CursorPage support
  • stop on empty, short, cursor-less, repeated-cursor, or maxPages boundaries
  • cover both cursor progression and backward compatibility

Fixes #403

Validation

  • npx vitest run tests/pagination-helper.test.ts (17 passed)
  • npm run typecheck
  • npm run lint
  • npx prettier --check src/pagination.ts tests/pagination-helper.test.ts
  • npm exec tsup (ESM, CJS, browser, and declarations built)
  • git diff --check

@David-patrick-chuks-02
David-patrick-chuks-02 merged commit 08c4691 into Lilly-Protocol:main Sep 6, 2026
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.

[Bounty: $100] Stop paginate from re-fetching the same page; advance on cursor metadata instead

3 participants