Skip to content

CS-725 [Bug] - Validate comment length against visible text, not raw Tiptap JSON - #3409

Merged
tofikwest merged 8 commits into
mainfrom
chas/comment-length-validator
Jul 27, 2026
Merged

CS-725 [Bug] - Validate comment length against visible text, not raw Tiptap JSON#3409
tofikwest merged 8 commits into
mainfrom
chas/comment-length-validator

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This is an automated pull request to merge chas/comment-length-validator into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Validate comment length against visible text, not raw Tiptap JSON, so formatted comments aren’t rejected. Caps raw content at 50k and counts Unicode code points for accurate limits. Addresses CS-725.

  • Bug Fixes
    • Added MaxCommentTextLength using extractCommentPlainText to count visible characters; supports paragraphs, headings, hard breaks, mentions, and lists; avoids double-counting line breaks in blockquotes.
    • Updated CreateCommentDto and UpdateCommentDto to use the validator, set RAW_CONTENT_MAX_LENGTH to 50,000, and documented the raw payload limit in OpenAPI.
    • Safer parsing: only treat content as Tiptap when it has a { type: 'doc' } shape and reject empty Tiptap documents; added unit tests for these cases and the original regression.

Written for commit fdd6cf3. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 27, 2026 5:00pm
comp-framework-editor Ready Ready Preview, Comment Jul 27, 2026 5:00pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped Jul 27, 2026 5:00pm

Request Review

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/comment-length-validator CS-725 [Bug] - Validate comment length against visible text, not raw Tiptap JSON Jul 14, 2026
@linear

linear Bot commented Jul 14, 2026

Copy link
Copy Markdown

CS-725

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/api/src/comments/utils/extract-comment-plain-text.ts Outdated
Comment thread apps/api/src/comments/dto/create-comment.dto.ts
Comment thread apps/api/src/comments/utils/extract-comment-plain-text.ts Outdated
Comment thread apps/api/src/comments/utils/extract-comment-plain-text.ts Outdated
Comment thread apps/api/src/comments/dto/create-comment.dto.ts
@chasprowebdev

Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it.

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it.

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/api/src/comments/dto/update-comment.dto.ts
Comment thread apps/api/src/comments/validators/max-comment-text-length.validator.ts Outdated
@chasprowebdev

Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it.

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai please review it.

@chasprowebdev I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chasprowebdev chasprowebdev self-assigned this Jul 15, 2026
@vercel
vercel Bot temporarily deployed to Preview – portal July 27, 2026 16:56 Inactive
@tofikwest
tofikwest merged commit 2c11188 into main Jul 27, 2026
11 checks passed
@tofikwest
tofikwest deleted the chas/comment-length-validator branch July 27, 2026 17:05
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.110.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants