Skip to content

fix(validation): enforce chat and server input limits#183

Open
nyxsky404 wants to merge 1 commit into
0rigin-c0de:mainfrom
nyxsky404:input-length-validation-fix
Open

fix(validation): enforce chat and server input limits#183
nyxsky404 wants to merge 1 commit into
0rigin-c0de:mainfrom
nyxsky404:input-length-validation-fix

Conversation

@nyxsky404
Copy link
Copy Markdown

Summary

  • Added shared message and server-name validation limits across the frontend and backend.
  • Trim and reject empty or over-limit content for server messages, direct messages, message edits, and server creation.
  • Added MongoDB maxlength safeguards, legacy Socket.IO validation hardening, and a focused validation unit script.

Fixes #135

Type of Change

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Tooling / developer experience

Validation

  • cd frontend && npm run lint
  • cd frontend && npm run build
  • Server starts with cd server && npm start, if backend code changed
  • I checked the feature or page I changed in the app

Additional checks:

  • cd server && npm run test:validation
  • cd server && node --check src/routes/chat.js
  • cd server && node --check src/routes/directMessages.js
  • cd server && node --check src/routes/servers.js
  • cd server && node --check src/socket/index.js

Screenshots or Recording

Not included. The UI changes are character counters and validation messages on existing inputs.

Notes for Reviewers

  • Message content is capped at 2000 characters.
  • Server names are capped at 100 characters.
  • Whitespace-only values are rejected after trimming.
  • npm start was not run locally because this workspace does not have server/.env / MONGO_URI configured.

@nyxsky404 nyxsky404 requested a review from 0rigin-c0de as a code owner May 27, 2026 16:13
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

@nyxsky404 is attempting to deploy a commit to the Sunil Kumar's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

No input length validation on message or server name fields

1 participant