Skip to content

Conversation

@chriszarate
Copy link
Contributor

What?

Prevent the sync manager from calling the saveRecord handler when CRDT persistence is not supported.

Why?

The only purpose of calling the saveRecord handler is to persist the CRDT document—either for the first time or after a previously persisted document is invalidated. Therefore, it should be called inside a check for syncConfig.supports.crdtPersistence.

For entities that should not or cannot be saved (such as the site settings entity), this bug resulted in a failing API request to save the entity (e.g., POST /wp-json/wp/v2/settings?_locale=user).

How?

  1. Wrap the saveRecord call in a check.
  2. Remove the redundant call to createEntityMeta. This was a bad merge artifact. Calling createEntityMeta is now handled in the entity's pre-persist hook.

Testing Instructions

  1. Check out this branch.
  2. Load a post for editing.
  3. Make a change and click Save.
  4. Ensure that there is no POST request to /wp-json/wp/v2/settings?_locale=user.

Testing Instructions for Keyboard

No UI changes in this PR.

@chriszarate chriszarate requested a review from pkevan November 19, 2025 22:56
@chriszarate chriszarate added [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Experimental Experimental feature or API. labels Nov 19, 2025
@github-actions
Copy link

github-actions bot commented Nov 19, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: pkevan <paulkevan@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

@pkevan pkevan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, and solves the issue.

@chriszarate chriszarate merged commit 1492c28 into wpvip/rtc-plugin Nov 20, 2025
42 of 43 checks passed
@chriszarate chriszarate deleted the fix/sync-persistence-supports-check branch November 20, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants