Skip to content

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

Open
github-actions[bot] wants to merge 6 commits into
mainfrom
chas/comment-length-validator
Open

CS-725 [Bug] - Validate comment length against visible text, not raw Tiptap JSON#3409
github-actions[bot] wants to merge 6 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 instead of raw Tiptap JSON to stop valid formatted comments from being rejected. Also 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 (Unicode code points). Supports paragraphs, headings, hard breaks, mentions, lists, and 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.
    • Hardened parsing: only treat content as Tiptap when it has a { type: 'doc' } shape and reject empty Tiptap documents; added unit tests covering these cases and the original regression.

Written for commit cb69fca. 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)
comp-framework-editor Ready Ready Preview, Comment Jul 14, 2026 7:09pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Jul 14, 2026 7:09pm
portal Skipped Skipped Jul 14, 2026 7:09pm

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
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.

1 participant