Repository navigation
Core Data: Keep read-only taxonomy fields out of collaborative edits - #84838
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +50 B (0%) Total Size: 8.65 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. default to a list of pages if there are no menus in
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused filtering handles stale documents while preserving editable fields, with regression coverage and no identified blocking issues.
0 open findings
What changed in this PR
Prevents stale read-only taxonomy data from marking unchanged terms as dirty during collaboration.
Changes:
- Filters read-only fields when writing and reading shared taxonomy documents, including older documents.
- Preserves editable and plugin fields.
- Adds regression coverage and documents the fix.
| File | Description |
|---|---|
| test/e2e/specs/editor/collaboration/http-only/collaboration-taxonomy-record-dirty.spec.ts | Reproduces category count changes between sessions. |
| packages/core-data/src/utils/test/crdt.jsdom.test.ts | Tests filtering and preservation of editable fields. |
| packages/core-data/src/utils/crdt.ts | Introduces taxonomy-specific read/write filtering. |
| packages/core-data/src/entities.js | Applies the taxonomy sync configuration. |
| packages/core-data/CHANGELOG.md | Records the bug fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Seeing CI errors across a bunch of PRs, I'm going to merge this PR to unblock things |
Follow-up to #79908. Related to #78594. Found through the failing Playwright job on #84584.
What?
Keep read-only taxonomy term fields out of collaborative edits so stale counts and links do not mark unchanged categories as dirty.
Why?
After another post is published, REST can return a category count of
1while its shared document still contains0. Applying that stale count as an edit changes the pre-publish button to "Save" and can trigger an unsaved-changes warning.Taxonomy record syncing was introduced in #74665. The comparison added in #79908 excludes equal values, but stale read-only values still differ and reach the store as edits. The original test passes on a fresh site; changing the count between tabs reproduces the failure on trunk.
How?
Use a taxonomy-specific sync config that excludes
id,count,link,taxonomy,_links, and_embeddedwhen writing and reading shared documents. Reading also filters documents created before this fix. Editable term fields, plugin fields, and taxonomy assignments continue to sync.Testing Instructions
The existing Playwright regression test now performs this sequence automatically.
Verification
Testing Instructions for Keyboard
Follow the same steps using Tab to reach each Publish button and Enter to open the panel. The change does not alter keyboard interaction.
Use of AI Tools
Codex investigated the failure, traced its history, implemented the fix and tests, and ran local verification.