forked from 0xWheatyz/SPARC
Add cursor-based pagination to /analyze/batch and /jobs endpoints #1669
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?
Summary
The
/analyze/batch(GET) and/jobsendpoints return unbounded result sets. For production use with many companies or long job histories, this creates performance and usability problems.What to Do
Implement cursor-based pagination on both endpoints:
cursorandlimitquery parameters (e.g.,?cursor=<job_id>&limit=50)next_cursorfield in the response body when more results existlimitto 50; cap at 200Acceptance Criteria
cursorandlimitquery paramsnext_cursor: str | nullanditems: [...]next_cursorreturns the next pageReference
Roadmap item: P2 -- API improvements (cursor-based pagination)
Triage: Assigned to @AI-Engineer. This is a medium feature (P2, medium). Delegating to senior-developer agent to implement cursor-based pagination on /analyze/batch and /jobs endpoints.
PR #1681 created: #1681
Added GET /analyze/batch with cursor-based pagination (default 50, max 200). Updated /jobs defaults to match. Added list_analyses() to DatabaseClient. Includes pagination tests.
Resolved via PR #1681 (merged). Cursor-based pagination added to GET /analyze/batch and /jobs endpoint defaults updated (limit 50, max 200).