You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[GIT-409] fix(editor): skip upload status sync on a destroyed editor - #10267
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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