Skip to content

fix(messages): reject non-decimal pagination values#161

Open
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/message-load-limit-parse
Open

fix(messages): reject non-decimal pagination values#161
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/message-load-limit-parse

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • make chat message pagination accept only plain decimal integer query values
  • reject surprising numeric spellings such as limit=1e2 and offset=0x10 instead of letting Number() coerce them into database ranges
  • keep existing defaults, lower bounds, and max-limit capping behavior

Verification

  • Direct Node check of normalizeMessagePagination for default, valid, malformed, non-decimal, and oversized limit cases

Note

pnpm vitest run src/app/api/chat/messages/pagination.test.js could not start in this Windows environment because project dependency setup runs a Unix-only postinstall (command, true) and the local Vitest config then fails while loading @vitejs/plugin-react/vite. The focused normalization behavior was verified directly with Node.

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.

1 participant