Skip to content

[comp] Production Deploy#2578

Merged
tofikwest merged 14 commits into
releasefrom
main
Apr 16, 2026
Merged

[comp] Production Deploy#2578
tofikwest merged 14 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 16, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Adds full Tiptap table support to policy PDF exports (CS-221), fixes stale task status after integration disconnects (CS-166), and accepts MIME types with parameters/whitespace in uploads (CS-217) to improve PDFs, task accuracy, and file upload UX.

  • Bug Fixes
    • CS-221: Render table nodes with borders, header fill, text wrapping, and colspan; join paragraphs/hardBreaks with newlines and render list items in cells with bullet/number markers; handle long tables with correct row height and mid-table page breaks; added regression tests.
    • CS-166: Exclude runs from disconnected connections in task UI and scheduler so stale failures don’t show or drive status.
    • CS-166: On disconnect/delete, re-evaluate failed tasks from remaining active automations (latest-per-checkId, best-effort); added tests and made re-eval order-independent and error-tolerant.
    • CS-217: Introduced IsMimeTypeField to strip parameters/whitespace, lowercase, and validate RFC 6838; applied to upload DTOs in attachments, tasks, task-management, and org-chart; removed dead blocklists; added tests.

Written for commit 0f2244f. Summary will update on new commits.

tofikwest and others added 10 commits April 16, 2026 16:12
Policy PDFs stripped table formatting because neither the server-side
(trust portal / all-policies bundle) nor the client-side (policy page
Download as PDF) renderer handled Tiptap table/tableRow/tableCell/
tableHeader nodes. The server renderer fell through to a default case
that rendered cells as stacked paragraphs; the client renderer had no
default and dropped tables entirely.

Adds a renderTable helper to both renderers that draws a jsPDF grid
with borders, a shaded header row, cell padding, text wrapping, and
colspan support. Includes unit tests covering header + data rows,
colspan, and empty tables.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
File upload endpoints were rejecting valid Content-Type values like
`application/pdf;charset=utf-8` or `application/pdf\n` with a 400
"Invalid MIME type format" error, because each DTO enforced the regex
/^[a-zA-Z0-9\-]+\/[a-zA-Z0-9\-\+\.]+$/ with no trim or parameter strip.

Extracts a shared `IsMimeTypeField` decorator (+ `normalizeMimeType`
helper) that:
- strips RFC 7231 media-type parameters (`;charset=...`) and whitespace
- lowercases the value before validation and persistence
- matches the RFC 6838 restricted-name-chars grammar

Applied to all four upload DTOs:
- attachments/upload-attachment.dto.ts
- tasks/dto/upload-attachment.dto.ts
- task-management/dto/upload-task-item-attachment.dto.ts
- org-chart/dto/upload-org-chart.dto.ts

Also removes dead `BLOCKED_MIME_TYPES` constants from two DTOs — the
actual blocklist lives in `attachments.service.ts` and operates on
the already-lowercased fileType.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t (CS-166)

After a user disconnects an integration (e.g. GitHub), tasks that were
marked 'failed' by that connection's check runs stayed stuck on 'failed'
forever, because nothing re-evaluates the task's automation state on
disconnect. In addition, the task detail "App Automations" panel kept
showing historical failed runs from the disconnected connection, and the
12-hour task-schedule job would re-mark done-then-overdue tasks as failed
using those stale runs.

Three changes, all reading-side filters + one re-evaluation on disconnect:

1. ConnectionService.disconnectConnection and deleteConnection now call
   reevaluateFailedTasksAfterDisconnect, which re-derives each affected
   failed task's target status from its remaining non-disconnected
   automations. Uses a local mirror of the scheduler's getTargetStatus.

2. CheckRunRepository.findByTask excludes runs from disconnected
   connections so the UI no longer counts stale "failed" history.

3. task-schedule.ts includes the same connection-status filter on its
   integrationCheckRuns include.

Check run rows are preserved for audit trail (matching the existing
soft-delete design for IntegrationConnection itself).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Follow-up to the CS-221 review: extractTextFromContent joins nested text
nodes with no delimiter, so a cell containing two paragraphs (e.g.
"Retention Period" and "30 days") rendered as the single concatenated
string "Retention Period30 days". hardBreak nodes had the same problem.

Adds an extractCellText helper to both renderers that joins top-level
block children with \n and converts hardBreak to \n. splitTextToSize
respects embedded newlines, so the cell wraps into separate visual rows.

Regression test asserts the concatenated strings do NOT appear in the
rendered PDF buffer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Expands extractCellText to treat bulletList / orderedList / listItem as
line-break boundaries, not just top-level block children. Previously a
cell whose only block was a bulletList with two items rendered as
"AlphaBeta" because recursion concatenated listItem text with no
delimiter. Now it renders as "Alpha\nBeta" and splitTextToSize wraps
each item to its own visual line.

Adds regression tests for:
- bullet list items in a cell
- cell text longer than the column width (wraps)
- 50-row table that forces a mid-table page break
- content following a table on the same page (yPosition advances)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
List items inside a cell were rendered as indistinguishable plain-text
lines, because the cell extractor joined listItem children with \n but
never prepended a marker. The top-level list renderer already uses "•"
for bulletList and "1.", "2." for orderedList — the cell path now
matches so a cell with a list reads as a list, not as unlabeled lines.

Adds regression test asserting (a) each item's text is present, (b) the
WinAnsi bullet byte (0x95, jsPDF's encoding of U+2022) appears in a
bulletList cell, and (c) numbered prefixes appear in an orderedList
cell.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(pdf): render Tiptap tables in policy PDF exports (CS-221)
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment Apr 16, 2026 9:14pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped Apr 16, 2026 9:14pm
portal (staging) Skipped Skipped Apr 16, 2026 9:14pm

Request Review

@linear
Copy link
Copy Markdown

linear Bot commented Apr 16, 2026

Two follow-ups to cubic's review on PR #2577:

1. Make the latest-run-per-checkId selection in deriveTargetStatusForTask
   order-independent: compare run.createdAt instead of trusting the
   caller's orderBy. Matches the scheduler's getTargetStatus.

2. Wrap reevaluateFailedTasksAfterDisconnect in try/catch at both call
   sites (disconnectConnection, deleteConnection). The primary disconnect
   has already persisted by the time re-evaluation runs; a transient DB
   error during this best-effort cleanup must not surface to the caller.

Adds regression tests: (a) reverse-sorted input still picks newest run
per checkId, (b) disconnect resolves successfully even when the runs
query throws.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 3 files

Requires human review: This PR introduces non-trivial PDF layout logic, including manual coordinate calculations and page-break handling for tables, which warrants human verification to ensure visual correctness.

…t-cleanup

fix(integrations): clear stale task status after connection disconnect (CS-166)
@vercel vercel Bot temporarily deployed to staging – portal April 16, 2026 21:06 Inactive
…tion

fix(api): accept MIME types with parameters or whitespace (CS-217)
@vercel vercel Bot temporarily deployed to staging – app April 16, 2026 21:13 Inactive
@vercel vercel Bot temporarily deployed to staging – portal April 16, 2026 21:13 Inactive
@tofikwest tofikwest merged commit 75ed5ba into release Apr 16, 2026
13 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.23.2 🎉

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.

2 participants