Skip to content

fix(comments): unify create + edit limit at 2000 chars (#1535)#1543

Closed
mattwoberts wants to merge 1 commit into
mainfrom
issue-1535-bug-no-char-limit-on
Closed

fix(comments): unify create + edit limit at 2000 chars (#1535)#1543
mattwoberts wants to merge 1 commit into
mainfrom
issue-1535-bug-no-char-limit-on

Conversation

@mattwoberts
Copy link
Copy Markdown
Contributor

Summary

  • Unifies the comment character limit at 2000 for both create and edit paths. The prior commit on main set AddNewComment to 4000 and EditComment to 2000, which would silently block users from editing comments they were allowed to post.
  • Updates the matching frontend constants (DEFAULT_MAX_LENGTH in CommentEditor, COMMENT_MAX_LENGTH in CommentInput, the explicit 2000 passed in ShowComment) so the live counter, disabled-submit gating, and backend rejection all agree.
  • Adjusts the comment validation tests to the new boundary.

Addresses GitHub issue #1535 (no character limit on comments enables spam).

Test plan

  • make lint clean
  • godotenv -f .test.env go test ./app/actions passes (incl. TestAddNewComment_TooLongContent, TestAddNewComment_AtMaxLength, TestEditComment_TooLongContent)
  • make watch: open a post, paste 2001 chars into the comment editor — counter goes red at the limit, Post button disables
  • Backspace to 2000 — Post enables, submit succeeds
  • Edit an existing comment past 2000 chars — Save disables; counter red
  • Switch to markdown mode — textarea hard-caps at 2000 chars natively
  • Force-bypass via DevTools — backend returns 400 with i18n error on content

🤖 Generated with Claude Code

The prior commit landed a 4000-char cap on new comments and a 2000-char
cap on edited comments, which would block users from editing comments
they were allowed to create. Align both create and edit to 2000 chars,
update the matching frontend constants, and adjust tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mattwoberts
Copy link
Copy Markdown
Contributor Author

Closing — wrong direction. Will open a new PR that aligns edit limit up to 4000 instead.

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