Avoid double editor transaction application#5909
Merged
ComputelessComputer merged 2 commits intoJul 4, 2026
Merged
Conversation
✅ Deploy Preview for old-char canceled.
|
73d8d57 to
456f3a3
Compare
625568f to
e7a2eb1
Compare
456f3a3 to
0bc5ce8
Compare
e7a2eb1 to
7a36050
Compare
0bc5ce8 to
16d00bd
Compare
7a36050 to
7bfdd35
Compare
16d00bd to
63793fa
Compare
7bfdd35 to
96364af
Compare
63793fa to
326f4ab
Compare
96364af to
fb04600
Compare
326f4ab to
2ae2648
Compare
fb04600 to
fc6e88a
Compare
2ae2648 to
b91ab61
Compare
fc6e88a to
a561f6c
Compare
b91ab61 to
ffb2bb6
Compare
a561f6c to
0838e9e
Compare
ffb2bb6 to
7081a61
Compare
Move editor change notifications into a ProseMirror plugin view update and remove custom dispatch handlers that re-applied transactions in uncontrolled React ProseMirror editors.
7081a61 to
060880f
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Move editor change notifications into a ProseMirror plugin view update and cancel pending debounced note saves before external state sync.
Note
Medium Risk
Touches how note/chat content is persisted and synced; behavior is covered by new plugin tests but regressions in save timing or missed updates are possible.
Overview
Stops using a custom
dispatchTransactionon chat and noteProseMirroreditors (and thedispatchEditorTransactionhelper foronUpdate/handleChange), so transactions are not applied twice when the host library already dispatches them.Change detection moves into a new
docChangeListenerPluginthat runs in the plugin viewupdatehook and calls back only when the document changed as part of a transaction—not on selection-only updates or when the doc is replaced viaview.updateStateduring controlledinitialContentsync.For the note editor, pending debounced saves are cancelled (
onUpdate.cancel()) before that external sync, and the debounced handler receives JSON from the plugin instead of re-reading the view insideflushChange.Reviewed by Cursor Bugbot for commit 060880f. Bugbot is set up for automated code reviews on this repo. Configure here.