Skip to content

RTC: Embeds are reloaded after every change with mixed editing modes (Visual & Code) #76598

Closed

Description

@desrosj

Description

When two users are editing a post with any embeds using real-time collaboration, the embeds refresh every single time the post is changed for users in the Visual Editor when another user is using the Code Editor.

Given that an embed could potentially be a large file that's prerendered like a PDF, or an oEmbed to an external provider, this can result in lots of stress on the server or user's machine re-requesting/re-downloading the file, or re-requesting the embed from the external service.

In the attached screen recording, you'll even notice that the embeds temporarily stop refreshing (likely due to the browser throttling the requests).

Step-by-step reproduction instructions

  1. Create a post with one or more embeds.
  2. Open two windows with the post edit screen open and visible.
  3. Enter the Code Editor for one and start typing.
  4. Observe that the user with the Visual Editor sees the embeds constantly refreshing

Screenshots, screen recording, code snippet

Screen.Recording.2026-03-17.at.2.24.41.PM.mov

Environment info

No response

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 Mar 17, 2026
  2. chriszarate commented on Mar 17, 2026

    @chriszarate
    Contributor

    Thanks for this report. In order to sync changes between the code editor and the visual editor, blocks must be re-parsed on every change, leading to the behavior you captured in your recording.

    In the future, we will likely need to restrict use of the code editor when collaborating with others.

  3. added theissue type on Mar 17, 2026
  4. alecgeatches commented on May 20, 2026

    @alecgeatches
    Contributor

    I took a look at this today and I can still reproduce:

    code-editor-embed-refresh.mov

    One option we have as Chris said above is to simply disable the code editor when in an RTC session, but the code editor is helpful to some workflows and I'm not a fan of that plan. I'm going to look into if we have another way to handle code-view updates, through throttling or waiting to parse until the code editor is closed.

  5. alecgeatches commented on May 20, 2026

    @alecgeatches
    Contributor

    @desrosj I've opened a PR in #78483 to address this issue. It allows code editor access, and avoids re-parsing the whole document from scratch on code editor updates. I'll spend a bit more time testing it tomorrow, but so far I'm happy with the results.

  6. alecgeatches commented on May 22, 2026

    @alecgeatches
    Contributor

    Closed in #78483!

    Note I also found an issue with code editing that causes the cursor to jump in #78483 (comment) when other users are editing, and I'm looking into a fix for that problem in a separate PR. Thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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