Repository navigation
RTC: Do not sync taxonomy term entities - #78594
Draft
maxschmeling wants to merge 1 commit into
Draft
maxschmeling wants to merge 1 commit into
maxschmeling wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -96 B (0%) Total Size: 8.18 MB 📦 View Changed
ℹ️ View Unchanged
|
maxschmeling
force-pushed
the
codex/disable-taxonomy-term-rtc-sync
branch
from
May 26, 2026 21:47
4123345 to
aecc97b
Compare
maxschmeling
marked this pull request as draft
May 28, 2026 23:40
This branch has not been deployed
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.
What?
Use collection-only RTC syncing for taxonomy entities.
Post records still sync taxonomy assignments such as
categoriesandtagsas part of the post entity. Taxonomy collection rooms such astaxonomy/categoryremain enabled so clients can be notified when the term collection changes, but individual taxonomy term rooms such astaxonomy/category:1are blocked.Why?
We investigated an RTC-only unsaved changes warning that appeared after scheduling a post and then leaving the editor, even though the post itself had no unsaved changes.
The dirty entity was not the post.
core/editorreportedisEditedPostDirty()as false, and the post had no non-transient edits. However,core.__experimentalGetDirtyEntityRecords()contained the default category term:taxonomycategory1The dirty term record had local raw values from the current site, but RTC-applied edits from stale term data. For example, on the affected staging environment the raw term contained staging URLs and current counts, while the synced edit contained production URLs and older counts.
This can happen because taxonomy terms were being treated as standalone syncable entities. A term like
Uncategorizeduses a stable RTC room key such astaxonomy/category:1, independent of the post being edited and independent of the site URL. If sync storage is copied between environments, or otherwise contains stale term data, stale updates for that term room can be loaded and applied as local edits on the current site.That marks the taxonomy term entity dirty, and the unsaved-changes warning uses
core.__experimentalGetDirtyEntityRecords(), not only the current post's dirty state. As a result, navigating away from a clean scheduled post can show the browser "changes may not be saved" warning.Taxonomy term records do not need collaborative entity editing for the post editor flow. Creating and assigning terms continues to use the normal REST/core-data path, selected term IDs continue to sync through the post record itself, and taxonomy collection syncing remains available for collection-level invalidation/refetch behavior.
Reproduction
This can be reproduced from a clean WP Studio environment by first creating valid RTC data for the default category term, then changing the local site URL so that the term record returned by REST no longer matches the term record stored in the RTC room.
Uncategorized. This allows the pre-publish panel to show the category suggestion.Suggestion: Assign a categorypanel appears. This loads the default category entity and opens thetaxonomy/category:1RTC room.taxonomy/category:1room has been requested by checking the RTC/updatesrequest.Before this fix, the browser can show the unsaved changes warning even though the post is clean. Inspecting dirty records shows the category term as dirty, with raw values from the current domain and edits from the previous domain stored in the individual term RTC room:
The post itself can be clean at the same time:
Notes from the verified reproduction:
taxonomy/category:1becauseMaybeCategoryPanelrequests the default category entity while checking whether to show the category suggestion.Testing Instructions
core.__experimentalGetDirtyEntityRecords()can containtaxonomy/category:1with stale URL/count edits after scheduling.Automated testing
npm run test:unit packages/core-data/src/test/entities.js -- --runInBandnpm run lint:js packages/core-data/src/entities.js packages/core-data/src/test/entities.jsImplementation Notes
Taxonomy entities now use
defaultCollectionSyncConfig. ItsshouldSynccallback allows collection rooms whereobjectIdisnull, for exampletaxonomy/category, and rejects individual term rooms whereobjectIdis present, for exampletaxonomy/category:1.