Real-time collaboration: Do not call saveRecord when persistence is not supported #73450
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?
Prevent the sync manager from calling the
saveRecordhandler when CRDT persistence is not supported.Why?
The only purpose of calling the
saveRecordhandler 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 forsyncConfig.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?
saveRecordcall in a check.createEntityMeta. This was a bad merge artifact. CallingcreateEntityMetais now handled in the entity's pre-persist hook.Testing Instructions
POSTrequest to/wp-json/wp/v2/settings?_locale=user.Testing Instructions for Keyboard
No UI changes in this PR.