[wp-trac] [WordPress Trac] #65008: Block Hooks / RTC: Auto-inserted blocks duplicated on page refresh or collaborator join

WordPress Trac noreply at wordpress.org
Wed Apr 1 08:41:49 UTC 2026


#65008: Block Hooks / RTC: Auto-inserted blocks duplicated on page refresh or
collaborator join
-----------------------------+--------------------
 Reporter:  Bernhard Reiter  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  7.0
Component:  Editor           |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+--------------------
 ''As reported [https://github.com/WordPress/gutenberg/issues/76176 here]
 by @ingeniumed, with some edits by myself''

 When real-time collaboration is activated, if a post contains blocks auto-
 inserted by the Block Hooks API, joining a real-time collaboration session
 (via page refresh or a second collaborator opening the post) causes the
 hooked blocks to be duplicated in the editor. The duplication compounds
 with each new session join, and each additional collaborator or refresh
 adds another copy of every hooked block.

 == Step-by-step reproduction instructions

 0. Enable real-time collaboration (in Settings > Writing).
 1. Create a new post and add a core/heading block and a core/paragraph
 block.
 2. Publish or save the post, then close it.
 3. Activate the
 [https://github.com/WordPress/gutenberg/blob/c21d3ce958e9c4c6f2f5053fa995a06d9740721a/packages
 /e2e-tests/plugins/block-hooks.php Gutenberg Block Hooks plugin from
 `packages/e2e-test/plugins`] (or any plugin that registers blocks via the
 Block Hooks API).
 4. Reopen the post. The Block Hooks API auto-inserts its blocks (in the
 after and last_child positions).
 5. Without saving, reload the post. Observe that the auto-inserted
 paragraph at the end of the post has been duplicated. Notice that every
 subsequent reload adds another copy.

 Alternative to item 5: Open the same post in a second browser window or
 tab to simulate a second collaborator joining the RTC session.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65008>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list