forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #1116
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
With large result sets,
/analyze/batchresults and/jobslists could contain thousands of items. Without pagination, responses will grow unbounded and clients will need to load everything at once.What to do
cursorandlimitquery parameters toGET /jobsandGET /analyze/batch(or the jobs list endpoint).next_cursorin the response envelope when more results exist.WHERE created_at < :cursor ORDER BY created_at DESC LIMIT :limit) rather than offset.Acceptance criteria
GET /jobs?limit=10returns at most 10 items and anext_cursor.cursor=<value>returns the next page.next_cursorisnull.Roadmap reference: P3 - API pagination
This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.