forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #1211
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?
Context
The batch analysis and job listing endpoints return unbounded result sets. As data grows this will cause slow queries and large response payloads.
Roadmap reference: ROADMAP.md > P3 > API pagination
What to do
cursor(opaque token encoding last seen ID + timestamp) andlimitquery parameters toGET /jobsandGET /analyze/batch.next_cursorfield in the response when more results are available.Acceptance criteria
GET /jobs?limit=10returns at most 10 results and anext_cursor.next_cursoras thecursorparameter returns the next page.next_cursor: null.This issue has been resolved on main. Cursor-based pagination is implemented in
SPARC/api.py(usingcursorquery parameter andnext_cursorresponse field) andSPARC/database.py. Closing as complete.