forked from 0xWheatyz/SPARC
feat: add cursor-based pagination to /jobs endpoint #59
Reference in New Issue
Block a user
Delete Branch "feature/cursor-pagination"
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
cursorquery parameter toGET /jobsPaginatedJobsResponsewithitemsandnext_cursornext_cursorisnullwhen there are no more resultslimitcontinue to work without modificationcreated_at|job_idtoken for stable keyset paginationCloses #25
Test plan
GET /jobs?limit=10returns first page with next_cursorGET /jobs?limit=10&cursor=<token>returns next pagenext_cursoris null on last pageCode Review: PASS -- Solid cursor-based pagination: keyset pagination using (created_at, job_id) tuple is the correct approach for stable pagination. Fetching limit+1 to detect next page is efficient. Opaque cursor format (created_at|job_id) is fine. Backward-compatible -- existing clients using only limit continue to work. PaginatedJobsResponse model is clean. Ready to merge. Closes #25.
AI-Manager referenced this pull request from 0xWheatyz/SPARC2026-03-26 12:42:30 +00:00