Skip to content

Add stable cursor pagination for /api/exports - #1002

Merged
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
Eldren-cmd:grantfox-exports-stable-cursor
Jul 29, 2026
Merged

Add stable cursor pagination for /api/exports#1002
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
Eldren-cmd:grantfox-exports-stable-cursor

Conversation

@Eldren-cmd

Copy link
Copy Markdown
Contributor

Closes #907

Summary

  • Adds opaque cursor pagination for GET /api/exports using stable (created_at, id) ordering via exportedAt DESC, id DESC
  • Returns pagination.hasMore and pagination.nextCursor while preserving legacy offset pagination when no cursor is supplied
  • Validates query params at the route boundary and returns structured 400 validation errors for invalid cursors/limits
  • Prevents non-admin callers from listing another developer’s exports via developerId
  • Documents the visible pagination behavior in docs/exports-access-logs.md
  • Fixes the existing error handler envelope call so validation errors serialize correctly

Testing

  • node_modules\.bin\jest.cmd src/routes/exports.test.ts src/services/reportExporter.test.ts --runInBand --forceExit --coverage --collectCoverageFrom=src/routes/exports.ts --collectCoverageFrom=src/services/reportExporter.ts
    • 19 tests passed
    • Changed-file coverage: exports.ts 97.87% lines, reportExporter.ts 96.38% lines
  • node_modules\.bin\eslint.cmd src/routes/exports.ts src/services/reportExporter.ts src/routes/exports.test.ts src/middleware/errorHandler.ts
  • Filtered tsc --noEmit showed no errors for touched files

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Eldren-cmd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me
greatest0fallt1me merged commit 04e198d into CalloraOrg:main Jul 29, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

All checks green — merging. Nice job! 🚀

@Eldren-cmd

Copy link
Copy Markdown
Contributor Author

Thank you veery much for all the comments. Your reolving and communication skills are excellent, glad to have worked with you. Thanks

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.

Add cursor pagination on /api/exports [b#042]

2 participants