fix: paginate GET /chat (limit + before cursor)
From the PR description
Summary
- Adds
limit(default 50, max 200) andbefore(ISO timestamp cursor) query parameters toGET /chat - Prevents unbounded chat list queries for active users with large chat histories
- Backward-compatible: existing callers with no query params get the first 50 chats (most recent)
Closes #105 Closes #114
Changes
backend/src/routes/chat.ts- limit + before-cursor pagination on the chat list querybackend/src/lib/__tests__/chatPagination.test.ts- static analysis tests verifying pagination is presentbackend/tsconfig.json- exclude__tests__dirs from the main tsc build (tests use vitest directly)backend/package.json-"test": "vitest run"script added
Test plan
- Unit tests added and passing (
npx vitest run) - Backend type check passes (
npx tsc --noEmit)
Our analysis
Paginate the chat list endpoint — read the full analysis →
Think the analysis missed something the PR description covers?
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-110.md from
inside the repo you want the changes in.