RTC: Enable custom-fields support for linked entities to persist CRDT…#78986
Draft
Mustafabharmal wants to merge 1 commit into
Draft
RTC: Enable custom-fields support for linked entities to persist CRDT…#78986Mustafabharmal wants to merge 1 commit into
Mustafabharmal wants to merge 1 commit into
Conversation
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?
Closes #78966
Closes #76784
Fix real-time collaboration syncing and persistence for linked entities such as Navigation menus, Templates, Template Parts, and Global Styles.
When collaboration is enabled, changes made to these entities are not reliably persisted and can be reverted after reloading the editor. In collaborative sessions, updates may also fail to sync correctly between users.
Why?
The RTC implementation persists document state in the
_crdt_documentpost meta field.However, the linked entity post types (
wp_navigation,wp_template,wp_template_part, andwp_global_styles) do not supportcustom-fieldsby default. Because of this, the REST API silently ignores attempts to save the_crdt_documentmeta field.As a result:
How?
Add
custom-fieldssupport for the linked entity post types when collaboration is enabled so that the_crdt_documentmeta field can be persisted through the REST API.This allows RTC document state to be stored and restored consistently for:
wp_navigationwp_templatewp_template_partwp_global_stylesTesting Instructions
Screenshots or screencast