Apply cursor pagination to remaining flat-list endpoints #191
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Apply the cursor-pagination convention from
docs/api-conventions.mdto the three remaining flat-list endpoints. The helpers inlib/api/pagination.tsand the reference implementation on/api/notes(#179, PR #190) apply unchanged.These endpoints are domain-bounded today — a user has tens of educations, contacts, or tokens, not thousands — so migrating them was deferred from #179. This ticket exists so the convention is consistent across every flat-list API surface before the Expo client (#183) lands and before #178 generates the OpenAPI spec.
Scope
For each endpoint below:
listPaginatedByUserIdto the repo (same shape asNotesRepository), keeping the existinglistByUserIdfor tests + server prefetches.parseCursorQuery+paginatedResponse..datafrom the response.Endpoints:
/api/educations(GET) — cursor over(start_date, id)if start_date is the current sort key, otherwise(created_at, id). Confirm against the existing route's ordering./api/profile/contacts(GET) — cursor over(display_order, id). Watch for ordering stability if the user reorders mid-page (acceptable to skip / repeat a row across pages, but document the trade-off)./api/account/tokens(GET) — cursor over(created_at, id).Update
docs/api-conventions.md"Currently paginated" section to list all four endpoints once they're migrated.Acceptance criteria
{ data, next_cursor, has_more }; tests cover the page boundary on both SQLite and Postgres.docs/api-conventions.md"Currently paginated" lists/api/notes,/api/educations,/api/profile/contacts,/api/account/tokens.Out of scope
useInfiniteQueryinfinite-scroll UI on the PWA. The PWA is decommissioned in #185; the Expo client (#183) does this natively./api/skill-sections,/api/jobs). They stay as flat trees by design.Composes with
#179 (PR #190),
lib/api/pagination.ts,docs/api-conventions.md, #183 (Expo client).Part of
#176