Skip to content

Add cursor pagination to the events listing endpoint #430

Description

@mikewheeleer

Paginate the events listing

Description

The events listing endpoint returns an unbounded array, which does not scale as data grows. This issue adds cursor-based pagination with a bounded page size.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-backend only.
  • Add opaque-cursor pagination (bounded default + max page size) to the events listing.
  • Return a stable next-cursor; keep existing filters working across pages.
  • Do not change the item shape.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/events-01-pagination
  • Implement changes
    • Write code in: the relevant module.
    • Write comprehensive tests in: cover the new behaviour and edge cases.
  • Test and commit

Test and commit

  • Run npm run lint, npm test, and npm run build.
  • Cover edge cases: empty set, exact-page boundary, over-limit clamp, invalid cursor.
  • Include the full test output in the PR description.

Example commit message

feat(events): add cursor pagination

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions