Skip to content

RTC: [Engine] Featured Image: remove image does not get removed in collaborative editing #74657

Closed

Description

@pkevan

Description

When editing a post with multiple users, when one user attempts to remove the featured image, it is not reflected until save.

Given the move to real time collaborations, we should make this accurately reflect the current state for all users to avoid confusion.

Step-by-step reproduction instructions

  1. Visit an edit post page with two individual users (user 1, user 2)
  2. With user 1, select a featured image - this will then appear for user 2
  3. With either user, remove the featured image which has just been added
  4. Note that it only disappears for the user who click the action
  5. Replacing an image causes the correct behaviour whereby an image is updated

Screenshots, screen recording, code snippet

Screen.Recording.2026-01-15.at.15.07.46.mov

Environment info

  • WP latest, Gutenberg trunk
  • Tested across different browser (one Chrome, one firefox in the recording)

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Jan 15, 2026
  2. added a commit that references this issue on Jan 15, 2026
    70b9f12
  3. smithjw1 commented on Jan 23, 2026

    @smithjw1
    Contributor

    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.
  4. chriszarate commented on Jan 23, 2026

    @chriszarate
    Contributor

    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 ) => {
    const recordValue = record[ key ];
    const editedRecordValue = editedRecord[ key ];
    const value = mergedEdits[ key ]
    ? { ...editedRecordValue, ...edits[ key ] }
    : edits[ key ];
    acc[ key ] = fastDeepEqual( recordValue, value )
    ? undefined
    : value;
    return acc;
    }, {} ),
    };
    if ( globalThis.IS_GUTENBERG_PLUGIN ) {
    if ( entityConfig.syncConfig ) {
    const objectType = `${ kind }/${ name }`;
    const objectId = 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.

  5. 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
  6. added theissue type on Feb 12, 2026
  7. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Feature] Real-time CollaborationPhase 3 of the Gutenberg roadmap around real-time collaboration[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions