Skip to content

fix(comment/create): validate request body with a zod schema - #1469

Open
rajanpanth wants to merge 1 commit into
SuperteamDAO:mainfrom
rajanpanth:pr5-comment-validation
Open

fix(comment/create): validate request body with a zod schema#1469
rajanpanth wants to merge 1 commit into
SuperteamDAO:mainfrom
rajanpanth:pr5-comment-validation

Conversation

@rajanpanth

Copy link
Copy Markdown

createComment received req.body unvalidated: message had only a client-side length limit (so the API accepted very large strings) and refType/type/ref ids were unchecked.

Adds a zod schema enforcing message length (1–280, matching the client limit), validating refType/type against their Prisma enums, and typing the id fields. Invalid payloads get a 400.

Uses the same z.nativeEnum(...) pattern already used elsewhere in the repo (e.g. ai-generate/* routes).

pnpm check-types and pnpm lint pass.

createComment received req.body unvalidated: message had only a
client-side length limit (so the API accepted very large strings) and
refType/type/ref ids were unchecked. Add a zod schema that enforces
message length (1-280), validates refType/type against their enums, and
types the id fields, rejecting invalid payloads with 400.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

@rajanpanth is attempting to deploy a commit to the Superteam Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@rajanpanth, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dd254fa8-4541-4c5c-940c-5c7e27a36b93

📥 Commits

Reviewing files that changed from the base of the PR and between af39bd1 and 72b926d.

📒 Files selected for processing (1)
  • src/pages/api/comment/create.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rajanpanth

Copy link
Copy Markdown
Author

The remaining Vercel status requires authorization by a Superteam organization member. Could someone authorize the external deployment when convenient? The same authorization gate also affects my related PRs #1465, #1466, #1467, and #1468.

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