Skip to content

feat: add cursor-based pagination for messages and posts#282

Merged
odesenfans merged 2 commits intomainfrom
od/cursor-based-pagination
Apr 9, 2026
Merged

feat: add cursor-based pagination for messages and posts#282
odesenfans merged 2 commits intomainfrom
od/cursor-based-pagination

Conversation

@odesenfans
Copy link
Copy Markdown
Contributor

Summary

  • Add get_messages_cursor() and get_posts_cursor() methods using cursor-based pagination (no COUNT query, faster for large result sets)
  • Add CursorPaginationResponse, CursorPostsResponse, and CursorMessagesResponse response models
  • Update get_messages_iterator() and get_posts_iterator() to use cursor-based pagination, eliminating duplicate results
  • Client-side validation: rejects sortBy=tx-time with cursor mode, caps page size at 200

Test plan

  • Verify get_messages_cursor() and get_posts_cursor() return correct cursor-paginated responses
  • Verify iterators paginate through all results using cursor mode
  • Verify ValueError is raised when using sortBy=tx-time with cursor methods
  • Verify page size is capped at 200
  • Verify next_cursor=None correctly terminates iteration

Add get_messages_cursor() and get_posts_cursor() methods that use
cursor-based pagination (faster, no COUNT query). Update iterators
to use cursor mode by default, eliminating duplicate results.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Failed to retrieve llama text: POST 502: Bad Gateway

Add stub implementations for get_posts_cursor and get_messages_cursor
to satisfy the abstract class contract.
@odesenfans odesenfans merged commit 6155684 into main Apr 9, 2026
37 checks passed
@odesenfans odesenfans deleted the od/cursor-based-pagination branch April 9, 2026 15:34
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