Skip to content

[GIT-409] fix(editor): skip upload status sync on a destroyed editor - #10267

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/git-409-intake-duplicate-crash
Nov 12, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/git-409-intake-duplicate-crash

Conversation

@b-saikrishnakanth

@b-saikrishnakanth b-saikrishnakanth commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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 useEditor rebuilds the editor (it depends on editable). 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:

  • Upload-status effect: returns early when the editor is destroyed. This is the crash in the report.
  • Content-sync effect: checks isDestroyed before reading editor.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

  • Bug fix (non-breaking change which fixes an issue)

Screenshots and Media (if applicable)

N/A

Test Scenarios

  • Enable Intake on a project → open a pending intake item → ⋯ → Mark as duplicate → pick a work item → the page keeps working, the item shows "Duplicate of …" with a read-only description, and a reload renders it
  • @plane/editor type check and build pass

References

  • GIT-409

Summary by CodeRabbit

  • Bug Fixes
    • Improved editor synchronization when the editor is unavailable or has been destroyed, and when upload-status storage is missing.
    • Prevented asset-upload status updates from running on a destroyed editor.

@github-actions

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit c25f38e.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

External-value synchronization now tolerates missing utility storage and skips destroyed editors. The asset-upload-status effect also skips destroyed editors.

Changes: Editor effect guards

Layer / File(s) Summary
External-value and upload-status guards
packages/editor/src/hooks/use-editor.ts
External-value synchronization treats missing utility storage or uploadInProgress as no upload in progress. Both effects return when the editor is destroyed.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Suggested reviewers: sriramveeraghanta

Merge Risk: Minimal · up to c25f3

The change prevents a crash when an editor is rebuilt, such as after an intake item is marked as a duplicate. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: skipping upload status sync on a destroyed editor, which matches the use-editor.ts effect changes that return early when the editor is destroyed. It also includes the …
Description check Passed The description follows the template. It explains the root cause (read-only toggle rebuilds the editor, and effects run on the destroyed instance), lists both changes in use-editor.ts, sets the Type o…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: skipping upload status sync on a destroyed editor, which matches the use-editor.ts effect changes that return early when the editor is destroyed. It also includes the ticket ID and conventional-commit prefix, which is acceptable.

Full details: Description check

Explanation

The description follows the template. It explains the root cause (read-only toggle rebuilds the editor, and effects run on the destroyed instance), lists both changes in use-editor.ts, sets the Type of Change to Bug fix, gives test steps and a reference to GIT-409. Screenshots is marked N/A. The template's Description and Type of Change sections are present and complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b1d2304a-e1d5-40b4-b104-f26958745814
Commits

Reviewing files that changed from the base of the PR and between 0b9ca51 and c25f38e.

Files selected for processing: 1

  • packages/editor/src/hooks/use-editor.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@makeplane

makeplane Bot commented Nov 12, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@sriramveeraghanta
sriramveeraghanta merged commit 9cefae8 into preview Nov 12, 2026
14 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/git-409-intake-duplicate-crash branch November 12, 2026 15:11
nettnikl pushed a commit to nettnikl/hangar that referenced this pull request Dec 1, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants