Repository navigation
fix(deps): migrate Tiptap security updates with Markdown compatibility guards - #19376
Conversation
|
Still blocked — do not merge at The same four existing suites pass 101/101 on original dependencies and fail 17/101 on this candidate after removing the standalone DOMPurify update. That baseline comparison isolates a real Tiptap/ProseMirror migration regression. Full-editor results and exact reproduction commands are in the body; passing types/builds do not override changed saved Markdown/link behavior. DOMPurify is safely isolated in #19377, so its fix need not wait for this migration. The security/performance benefits justify a future compatible editor migration, but this evaluated version-only candidate is intentionally retained as a draft with failing evidence. No expectations were weakened to accept changed authored content. |
|
The complete Node 24 PR CI run independently confirms 19 failing editor tests across four shards: Markdown dirty state, last-row table deletion, toggle insertion, inline-code/bold link labels, raw-source transport and ordered-list tokenizers. This matches the full local editor result and extends the narrower four-suite baseline comparison. The candidate remains draft / do not merge; these are not waived by successful types/builds. |
Migration investigation: improvements pushed; serialization hold remainsHead The implementation changes repair three independently diagnosed causes:
The four remaining original failures concern unnecessary escaping of authored literal source: malformed citations, invalid wiki links, legacy transport-looking text and another codec's envelope. A global escaping bypass would corrupt newly typed literal Markdown; making those text spans inert atoms would degrade editability. Neither workaround was added, and no existing assertion was weakened. New save/reopen checks protect typed Initial controlled result: the four original suites improved from 84 passed / 17 failed to 13 fewer failures; ordered-list's two separate failures are also repaired. Full editor run, exact-head types/build and isolated rendered checks are being collected below. Saved Markdown reaches local/folder/SSH files and independently updated peers, so these four source-contract failures still prevent a safe merge; no wire/schema change was introduced. |
|
The Markdown migration now passes the complete existing editor suite: 1,431 passed, 0 failed, 2 existing skips. Frozen install, application typechecks, production build, and changed-file lint pass. New tests cover literal syntax, blank initialization, list detection, cross-paragraph references, immutable-node cache invalidation, and parser-error fallback; original assertions were retained. Full production extension graph benchmark (macOS arm64 / Node 26, 2,000 paragraphs containing malformed wiki syntax): first save 26.7 ms, save after one-paragraph edit 5.9 ms, repeated saves 4.8–5.8 ms. The serializer preserves the exact source in this fixture. This is a local diagnostic, not a platform-wide guarantee. The optional E2E TypeScript project is not green: both the pre-Tiptap checkout and candidate report 190 errors at identical file/line positions and diagnostic codes; the new spec has no diagnostics. Application Full E2E and PR CI are running on head Three-platform goldens use production-identical commit |
|
Current candidate: 018e219. Still draft pending final CI execution.
The body contains the complete rationale, compatibility design, commands and evidence. The other seven dependency PRs are already merged; this PR remains unmerged while its final gates are open. |
Table editing: visual evidenceSource CI run · Product commit These four captures come from the earlier migration candidate, before the final inline-scan performance fix. The table scenario passed; the broader run had separately documented failures. The final product commit subsequently passed all 16 focused editor tests. A separate final-code screenshot run will add the other scenarios. 1. Table after Backspace: empty row removed; both populated rows remain.Scenario: 2. Table after Backspace: empty row removed; both populated rows remain.Scenario: 3. Table before Backspace: header, two populated rows, and the empty row selected for removal.Scenario: 4. Table before Backspace: header, two populated rows, and the empty row selected for removal.Scenario: The product PR still tracks its separate full-CI and Windows golden-test status; this gallery does not override those results. |
018e219 to
60fcbe7
Compare
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
📝 WalkthroughWalkthroughThe change pins Tiptap development dependencies to Priority: ➖ Normal Merge Risk: 🔵 Low · up to Saving nested literal Markdown can change its source representation to escaped syntax while preserving the rendered document. This is a narrow, low-impact preservation regression. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Map nested block nodes during literal-source serialization · src/renderer/src/components/editor/rich-markdown-literal-serialization.ts:50-70
50-70: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winMap nested block nodes during literal-source serialization
When
getMarkdown()enters the escaped-output branch,blocksmaps only top-level paragraphs and headings. A nested list paragraph therefore uses upstream escaping. For nested text[literal],@tiptap/[email protected]produces- \[literal\], while validated top-level text can produce[literal]. A save that consumeseditor.getMarkdown()can rewrite the nested source representation.The existing nested-block test uses
[literal](./a), where escaping is correct because unescaping creates a link. It only checks reopened JSON, so it does not detect this source rewrite. Include nested block nodes in the mapping and assert the exact nestedgetMarkdown()output for[literal].
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 438988f6-1a95-4fe0-b73f-8c4f6a67d0e1
📒 Files selected for processing (1)
src/renderer/src/components/native-chat/NativeChatPromptEditor.test.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Rebased onto main and validated final head
Rebase follow-ups: removed a redundant HTML-match wrapper to meet the current file-size limit, and awaited React updates in three newly added native-chat skill-pill tests. All original assertions remain. The browser-history performance test failed its budget once on the preceding run, then passed locally and in final CI without changing the implementation or budget. Merging with the final head pinned; no administrative check bypass. |
…y guards (stablyai#19376) * chore(deps): evaluate coordinated Tiptap security migration * fix(editor): adapt link ranking and initialization for Tiptap 3.31 * fix(editor): preserve literal Markdown through Tiptap serialization * test(editor): cover literal saves in local folder and paired workspaces * test(editor): reselect folder after closing its final tab * perf(editor): avoid repeated inline source-marker lookahead scans * refactor(editor): inline redundant HTML match wrapper * test(chat): await Tiptap React skill-pill rendering --------- Co-authored-by: m4air <[email protected]> Co-authored-by: m4air <[email protected]>





ELI5
Update Tiptap for security and correctness fixes while preserving existing Markdown documents. The migration passes every existing editor regression test, plus new literal-source and tokenizer-boundary tests.
What Changed / Why
Align direct Tiptap packages from 3.22.4/3.22.5 to exact 3.31.3, with their coordinated extension graph, ProseMirror View 1.42.3, Model 1.25.11, Inputrules 1.5.1 and Linkify 4.3.3. Other dependency updates are already on main and outside this PR's diff.
Upstream releases include prototype-safe attribute merging (3.30.4), Markdown attribute CPU-exhaustion protection (3.30.5), nested-list serialization and lower React node-view overhead (3.30.6), mobile node-view freeze repair (3.31.1), the ProseMirror paste-XSS fix (3.31.2), and a React declaration repair (3.31.3).
Adapt the existing integration contracts:
start()no longer supplies that signal.[. Keep block look-ahead and the exact keyed-marker matching/decoding unchanged. This fixes a measured slowdown on long paragraphs during save validation.The original update introduced 19 existing test failures; all are repaired without weakening their assertions. Literal source stays editable, and typed formatting syntax must remain literal after reopening. The document schema, codec envelope, remote wire, and host-qualified file route are unchanged.
September 14 rebase validation
Rebased cleanly onto main
b8554f1c59a68c2b9770f125485aec6c5b97c8dc; current headbe68ca8a01e97c7d970a91d2e8fed55f79b28e6f. The dependency/integration scope remains unchanged, with one additional native-chat test adaptation.18038cfc35; final head changes only native-chat test timing (git/folder/paired saves, nested toggles, tables, ordered-list exit, prose reflow, link bubbles and golden save/reopen). All final-head CI checks are green.The evidence below describes the earlier candidate. The expanded screenshot run was cancelled and did not publish its promised gallery; the four linked table captures remain available.
Testing / evidence
Final candidate:
018e219856ae42e0cdeb589472a216d75a6ca467.pnpm tc, production electron-vite build, changed-file lint: passed.pnpm audit --json: pre-Tiptap checkout has one moderate advisory (GHSA-cp6q-959q-f8rh); candidate has zero. This covers the root graph, not every subproject.__proto__input creates inheritedonclickon the old version but no inheritedonclickon 3.31.3; ordinary class attributes are preserved.Local performance probes use the complete production extension graph on macOS arm64/Node 26. A 2,000-paragraph malformed-wiki document previously measured about 27 ms for its first save and 6 ms after a one-paragraph edit. A single approximately 100 KB paragraph exposed repeated inline suffix scans: removing them reduced save-after-edit from about 128 ms to 27 ms; cached repeats take about 2 ms. These are stress diagnostics, not a cross-platform latency guarantee. Source equality is asserted in the probes; the new boundary tests cover Unicode, punctuation, emphasis, HTML, wiki links and citations.
Full E2E before the final scan optimization: 612 passed / 4 failed / 102 skipped, plus 46 passing SSH checks. Raw logs are authoritative: shard 6 has a misleading green badge but reports two failures before a post-summary cancellation. Three failures match earlier unchanged-dependency controls: background browser-tab title and two paired-browser assertions. These workflows are not claimed to work on either version.
The fourth failure was the new folder fixture: saved bytes were correct, but closing its only tab intentionally returns to the landing screen (
tabs-close-actions.ts). The test now reselects the folder before reopening, using the existing helper. No source/content assertion changed. Git and paired-remote save/reopen passed that full run; the corrected folder case now passes the final focused run.All local commands use
ORCA_BACKGROUND_LAUNCH=1; rendered app checks run only on isolated CI displays. The new E2E spec captures saved Markdown and screenshots. The existing workflow uploads artifacts on failure; successful assertions remain in job logs.Visual proof
Before/after table screenshots with full-window and editor-detail captures. These are labeled with the earlier candidate and source run; they are not presented as final-head captures.
Final-code screenshot gallery run retains successful captures for 15 scenarios: git/folder/paired-remote save/reopen, nested toggles, table before/after, all three ordered-list exit paths, four prose reflow cases, and link-overlay display/editing. It will publish the captioned gallery and saved Markdown directly to this PR after every scenario passes. This isolated evidence branch changes only test capture/retention/publication, with identical product code to
018e219856ae42e0cdeb589472a216d75a6ca467.Linked Issue
User-requested careful dependency review, validation, and Tiptap investigation.
Review