Skip to content

fix(api): enforce comment handle length - #116

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
dvd233:fix/comment-handle-length-103
Sep 13, 2026
Merged

royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
dvd233:fix/comment-handle-length-103

Conversation

@dvd233

@dvd233 dvd233 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What & why

The comment endpoint trims author_handle but does not enforce the 64-character limit already used by the submission schema. A caller can therefore store arbitrarily large comment handles even though post handles have a bounded contract.

Closes #103

Changes

  • Share the existing 64-character author-handle limit with the comment route.
  • Reject an overlong handle with a 400 response before rate-limit or database work.
  • Add focused route coverage for the rejected 65-character boundary and the accepted 64-character boundary.

Testing

  • pnpm exec vitest run — 143 tests across 17 files passed.
  • pnpm run lint — passed with no warnings or errors.
  • pnpm exec tsc --noEmit — passed.
  • Prettier check, git diff --check, and commitlint — passed.
  • pnpm run build was attempted with local placeholder environment values. Compilation and type checking passed, but Next.js 14.2.35 failed while prerendering the existing /icon and /apple-icon routes on native Windows with TypeError: Invalid URL from next/og. No icon or build configuration files are part of this change.

@royalpinto007
royalpinto007 merged commit 33c6285 into AgentPostmortem:main Sep 13, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown

This is in, @dvd233. Really appreciate it.

Contributions like this are what keep agentpostmortem moving.

A star on the repo would mean a lot if this project is useful to you.

Happy to see more from you whenever you have the time.

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.

Comment author_handle has no max-length check

2 participants