Skip to content

Ignore mutations that is not under editor#3290

Merged
JiuqingSong merged 2 commits intomasterfrom
u/jisong/removemutationnotundereditor
Feb 25, 2026
Merged

Ignore mutations that is not under editor#3290
JiuqingSong merged 2 commits intomasterfrom
u/jisong/removemutationnotundereditor

Conversation

@JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Feb 24, 2026

in textMutationObserver, we will go through mutations that is not made by content model and see if we can reconcile the change and reflect it in existing cached Content Model. And if an mutation happens under an entity, we should ignore it.

However, it is possible that we delete an entity node from editor and modify some node under this deleted node. Now when we handle this mutation, since the target node is already removed, existing code will return false when we check if it is under an entity. This causes the mutation won't be ignored and finally an existing cache will be invalidated.

Fix: Check if the target node is under editor. If so, directly ignore this change. So cache can be preserved.

@JiuqingSong JiuqingSong changed the title Remove mutations that is not under editor Ignore mutations that is not under editor Feb 24, 2026
@JiuqingSong JiuqingSong marked this pull request as ready for review February 25, 2026 00:03
@JiuqingSong JiuqingSong merged commit abb61fb into master Feb 25, 2026
7 checks passed
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.

2 participants