Skip to content

Do not invalidate cached model for ContentChangedEvent#3291

Merged
JiuqingSong merged 1 commit intomasterfrom
u/jisong/donotclearcache
Feb 27, 2026
Merged

Do not invalidate cached model for ContentChangedEvent#3291
JiuqingSong merged 1 commit intomasterfrom
u/jisong/donotclearcache

Conversation

@JiuqingSong
Copy link
Collaborator

Today everytime we got a ContentChangedEvent that does not have a model object in it, we will clear model cache. We do this because if some old plugin code made change to editor content and trigger this event, it means the model is not matching the DOM. But actually we have MutationObserver to help us detect the DOM change and refresh/invalidate cache, so no need to clear cache for the event specifically.

The motivation of this change is that I found an issue that if an entity is inserted not directly under root level, and then it triggers this event, cache is cleared, next time when we render, we need to rebuild the parent nodes for the entity, which somehow can cause the entity to be reloaded since its parent node got changed.

@JiuqingSong JiuqingSong merged commit b711a62 into master Feb 27, 2026
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/donotclearcache branch February 27, 2026 17:32
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