You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RTC: [Engine] Featured Image: remove image does not get removed in collaborative editing #74657
We are also seeing an issue that when a featured image is added by one user, it disappears when a second user joins the same post, not every time but some of the time.
What the Issue Was
The featured image state (stored in post meta, e.g. _thumbnail_id) does not reliably sync between collaborators unless the change is committed via a save. Practically, this presents as “featured image gets removed” when a second collaborator enters, but the more accurate framing is: the featured image change can be in an uncommitted/autosave-dependent state, and when the collaboration state is reconciled on join, the meta-backed change may not persist/sync consistently.
How We Solved It
We were able to reproduce the behavior consistently and observed:
Adding/removing a featured image may sync intermittently if autosave happens to occur at the “right” time.
Manually saving the draft immediately after setting the featured image makes it sync reliably and persist for both editors.
The same principle applies to removal, reliable after a save.
The cause, as @pkevan researched and found, is that we are applying edits to the CRDT document only after they have been compared against the persisted record. In the link below, see how edit.edits is constructed and some edits are removed:
// Clear edits when they are equal to their persisted counterparts
// so that the property is not considered dirty.
edits: Object.keys(edits).reduce((acc,key)=>{
constrecordValue=record[key];
consteditedRecordValue=editedRecord[key];
constvalue=mergedEdits[key]
? { ...editedRecordValue, ...edits[key]}
: edits[key];
acc[key]=fastDeepEqual(recordValue,value)
? undefined
: value;
returnacc;
},{}),
};
if(globalThis.IS_GUTENBERG_PLUGIN){
if(entityConfig.syncConfig){
constobjectType=`${kind}/${name}`;
constobjectId=recordId;
getSyncManager()?.update(
objectType,
objectId,
edit.edits,
Assuming neither user hits "Save" after a featured image is set, the persisted record will reflect featured_media: 0 for both users throughout the replication steps. Therefore, any attempt to remove the featured image (a.k.a., set featured_media to 0) will result in the removal of that change from edit.edits and the CRDT document will not be updated.
If instead we provide the "raw" edits to CRDT update function, then it will correctly compare the new value against what is in the CRDT document—not the persisted document. Our comparison logic in that function is robust and well-tested, so this is a safe change.
A category syncing issue, noted here by @alecgeatches, is a manifestation of this same issue.
changed the title [-]Featured Image: remove image does not get removed in collaborative editing[/-][+][Engine] Featured Image: remove image does not get removed in collaborative editing[/+]on Feb 12, 2026
changed the title [-][Engine] Featured Image: remove image does not get removed in collaborative editing[/-][+]RTC: [Engine] Featured Image: remove image does not get removed in collaborative editing[/+]on Feb 12, 2026
Activity
Change featured_media value to null on image removal
smithjw1 commentedon Jan 23, 2026
We are also seeing an issue that when a featured image is added by one user, it disappears when a second user joins the same post, not every time but some of the time.
What the Issue Was
The featured image state (stored in post meta, e.g. _thumbnail_id) does not reliably sync between collaborators unless the change is committed via a save. Practically, this presents as “featured image gets removed” when a second collaborator enters, but the more accurate framing is: the featured image change can be in an uncommitted/autosave-dependent state, and when the collaboration state is reconciled on join, the meta-backed change may not persist/sync consistently.
How We Solved It
We were able to reproduce the behavior consistently and observed:
chriszarate commentedon Jan 23, 2026
The cause, as @pkevan researched and found, is that we are applying
editsto the CRDT document only after they have been compared against the persisted record. In the link below, see howedit.editsis constructed and some edits are removed:gutenberg/packages/core-data/src/actions.js
Lines 400 to 422 in 6c48fc8
Assuming neither user hits "Save" after a featured image is set, the persisted record will reflect
featured_media: 0for both users throughout the replication steps. Therefore, any attempt to remove the featured image (a.k.a., setfeatured_mediato0) will result in the removal of that change fromedit.editsand the CRDT document will not be updated.If instead we provide the "raw"
editsto CRDT update function, then it will correctly compare the new value against what is in the CRDT document—not the persisted document. Our comparison logic in that function is robust and well-tested, so this is a safe change.A category syncing issue, noted here by @alecgeatches, is a manifestation of this same issue.
[-]Featured Image: remove image does not get removed in collaborative editing[/-][+][Engine] Featured Image: remove image does not get removed in collaborative editing[/+][-][Engine] Featured Image: remove image does not get removed in collaborative editing[/-][+]RTC: [Engine] Featured Image: remove image does not get removed in collaborative editing[/+]