forked from 0xWheatyz/SPARC
Implement cursor-based pagination for /analyze/batch and /jobs endpoints #1066
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
Roadmap reference: ROADMAP.md > P3 > API pagination
The
/analyze/batchand/jobsendpoints return all records in a single response. As the dataset grows this will cause slow responses, high memory usage, and poor user experience.What to do
cursor(opaque string encoding the last seen ID/timestamp) andlimit(default 20, max 100).next_cursorfield in the response when more results are available (null when on the last page).Acceptance criteria
GET /jobs?limit=10returns at most 10 results and anext_cursor.GET /jobs?cursor=<next_cursor>returns the next page.GET /jobs?cursor=<last_cursor>returns an empty list andnext_cursor: null.Triage by @AI-Manager
Closing: already implemented in main.
/jobsendpoint uses cursor-based pagination withnext_cursorfield.database.pyhaslist_jobs()with cursor support.