Repository navigation
[GIT-409] fix(editor): skip upload status sync on a destroyed editor - #10267
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
Converge the editor and live with upstream makeplane/plane v1.5.0 (b4b48c9, 8e07d40, 9cefae8). Backport of upstream makeplane/plane b4b48c9 (makeplane#10101), 8e07d40 (makeplane#10121) and 9cefae8 (makeplane#10267), with the happy-dom 21.0.4 pin of b98e1de (makeplane#10144): Tiptap 3.31.3, @tiptap/y-tiptap 3.0.9, Hocuspocus 3.4.4, Redlock and happy-dom; tippy.js, y-prosemirror and @hocuspocus/transformer are gone. The document codecs come from one factory, with a new @plane/editor/server entry on happy-dom that live imports. This closes GHSA-cp6q-959q-f8rh on @tiptap/core. Adapted: - The shared codecs keep normalizeDocumentJSON on both the browser and the server entry. - Paste parsing stays on parseInertHTML; prosemirror.css is now copied from the 3.31.3 core style (injectCSS stays off) and loses the tippy rule. - live's onAuthenticate is now upstream's: Hocuspocus 3 names the per-socket config connectionConfig, so the guest read-only flag lands there. The fork's secret-key middleware on the document controller, the PDF asset fetch guard and the Compose live service stay. - The delete plugin takes ySyncPluginKey from @tiptap/y-tiptap, so it still ignores remote collaborator changes; markdown paste reads tiptap-markdown's runtime parser through a local type, which the typed v3 storage leaves out; the callout keeps stringToEmoji. - The editor's security suites keep running without a DOM; upstream's hook and placeholder tests run in a separate happy-dom vitest project. - Title saves stay with the editing client connection's credential, so upstream's Redis integration test renames the title from a client rather than from a server-side direct connection. - The browser codecs' @tiptap/html DOMParser call is recorded as a reviewed Trusted Types sink in the web and space inventories.
Description
Marking an intake item as a duplicate crashed the whole page with
Cannot read properties of null (reading 'commands').Marking a duplicate makes the description read-only, so
useEditorrebuilds the editor (it depends oneditable). Effects then ran once more on the old, destroyed instance, and Tiptap v3 clears that instance's command manager and extension storage.Changes in
packages/editor/src/hooks/use-editor.ts:isDestroyedbefore readingeditor.storage.utility, which is reset to{}on a destroyed editor and would throw on destructuring.The new editor instance re-runs both effects, so content sync and upload status still apply to it.
Type of Change
Screenshots and Media (if applicable)
N/A
Test Scenarios
@plane/editortype check and build passReferences
Summary by CodeRabbit