Skip to content

fix: unwrap none loro race condition#3890

Open
404Wolf wants to merge 1 commit into
mainfrom
wolf/fix-history-double-call-panic
Open

fix: unwrap none loro race condition#3890
404Wolf wants to merge 1 commit into
mainfrom
wolf/fix-history-double-call-panic

Conversation

@404Wolf

@404Wolf 404Wolf commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: af7b2285-700b-4e3a-8ad7-9bf1fa9b8ee5

📥 Commits

Reviewing files that changed from the base of the PR and between d13b660 and a4e98f7.

📒 Files selected for processing (1)
  • js/app/packages/core/component/LexicalMarkdown/collaboration/undo.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where undo/history was incorrectly recorded during editor initialization, causing unexpected undo behavior. History recording now properly defers until the editor is fully initialized.

Walkthrough

This PR modifies the undo history registration to defer recording history updates until the editor completes initialization. A new internal isReadyForHistory flag starts as false and blocks the history update listener from processing changes. The flag is set to true inside the CLEAR_EDITOR_COMMAND and CLEAR_HISTORY_COMMAND handlers, after closing any active undo group, allowing subsequent editor updates to be processed by the existing merge and state logic.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the race condition being fixed, the problem it caused, and how the deferred history recording resolves it.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'fix:' prefix and is 36 characters, well under the 72 character limit.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant