Skip to content

fix: normalize chat message pagination#114

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/chat-messages-pagination
Jun 27, 2026
Merged

fix: normalize chat message pagination#114
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/chat-messages-pagination

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • add shared normalization for GET /api/chat/messages pagination query params
  • fall back for malformed limit/offset values instead of passing NaN or negative values into Supabase range
  • cap oversized limits at 100 and cover defaults, malformed input, and caps with regression tests

Fixes #113.

Validation

  • node --input-type=module -e "...normalizeMessagePagination assertions..."
  • corepack pnpm exec vitest run src/app/api/chat/messages/pagination.test.js (blocked: local Vitest config fails before tests with @vitejs/plugin-react importing vite/internal)
  • corepack pnpm exec prettier --check src/app/api/chat/messages/route.js src/app/api/chat/messages/pagination.js src/app/api/chat/messages/pagination.test.js (blocked: missing prettier-plugin-svelte in local install)
  • git diff --check

@ralyodio ralyodio merged commit ee0812e into profullstack:master Jun 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: chat message pagination accepts malformed limit and offset values

2 participants