RTC: Do not sync taxonomy term entities#78594
Open
maxschmeling wants to merge 1 commit into
Open
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: -95 B (0%) Total Size: 8.04 MB 📦 View Changed
ℹ️ View Unchanged
|
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?
Disable RTC entity syncing for taxonomy term records.
Post records still sync taxonomy assignments such as
categoriesandtagsas part of the post entity. This only removes the separate Yjs document/sync room for individual taxonomy term entities liketaxonomy/category:1.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, butcore.__experimentalGetDirtyEntityRecords()contained the default category term:taxonomycategory1The term's local raw record came from the staging site, but the synced edit contained production URLs and counts. This can happen because taxonomy terms were being treated as standalone syncable entities. A term like
Uncategorizeduses a stable room key such astaxonomy/category:1, independent of the post being edited. If sync storage is cloned or shared across environments, stale updates for that term room can be loaded and applied as local edits on the staging 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, and selected term IDs continue to sync through the post record itself.
Testing Instructions
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.js