Repository navigation
RTC: Editing a non-synced custom core-data entity leaves hasUndo() false #80722
Description
Description
When Real-Time Collaboration is active in the post editor, edits made to a custom core-data entity are accepted by core-data but are not added to the editor's Undo/Redo history.
The custom entity becomes dirty and contains the expected edits, but select( 'core' ).hasUndo() remains false and the editor's Undo button remains disabled.
The same custom entity edits create working undo levels when Real-Time Collaboration is disabled.
Dynamic Tables provides one reproducible example, but this behavior may affect any plugin that edits a separate custom core-data entity while Real-Time Collaboration is active.
Why this matters
WordPress plugins may use custom core-data entities for structured data that is semantically separate from post content.
These entities do not currently have a supported way to participate in Gutenberg RTC synchronization. Activating RTC for the post should not silently remove the normal core-data undo behavior for those entities.
Step-by-step reproduction instructions
Steps to reproduce
-
Enable the Gutenberg plugin and Real-Time Collaboration under Settings → Writing.
-
Register and load a custom core-data entity.
-
Open a post in the block editor.
-
Edit the custom entity using
editEntityRecord():wp.data.dispatch( 'core' ).editEntityRecord( 'dynamic-table-blocks', 'table', tableId, edits );
Do not pass
undoIgnoreorisCached, so both use their default false values. -
Inspect the resulting state:
const core = wp.data.select( 'core' ); console.log( { hasEdits: core.hasEditsForEntityRecord( 'dynamic-table-blocks', 'table', tableId ), edits: core.getEntityRecordEdits( 'dynamic-table-blocks', 'table', tableId ), hasUndo: core.hasUndo(), hasRedo: core.hasRedo(), } );
Actual result
The custom entity reports:
hasEdits: true- A non-empty
editsobject hasUndo: falsehasRedo: false
The editor's Undo button remains disabled.
After disabling Real-Time Collaboration and reloading the editor, the same custom entity edit creates an undo level and Undo works.
Expected result
Activating RTC for a synced post should not silently remove undo history for non-synced custom core-data entities edited in the same editor.
Core-data should either:
- preserve normal undo behavior for non-synced entities while RTC manages synced entities; or
- provide a supported public compatibility mechanism for custom entities.
This report is about maintaining existing core-data Undo/Redo behavior. It does not require the custom entity itself to become collaboratively synchronized.
Additional context
The active RTC sync undo manager appears to replace the regular core-data undo manager for the editor session. The sync undo manager tracks synchronized entities, while addRecord() does not record ordinary edits for a non-synced custom entity.
This appears related to #79510, but that change addresses fallback when collaboration is unavailable. In this case, collaboration remains active for the post while the editor also edits a separate non-synced entity.
Screenshots, screen recording, code snippet
No response
Environment info
- WordPress: 7.0.2
- Gutenberg: 23.6.0
- Theme: Twenty Twenty-Four
- Browser: Chrome (current version)
- Plugin Library: Dynamic Tables
- Real-Time Collaboration: enabled
- Custom entity:
- Kind:
dynamic-table-blocks - Name:
table - Numeric record ID
- Custom REST endpoint
- Kind:
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
giteshsarvaiya commentedon Jul 28, 2026
While investigating this issue and the possibilities around it, I found a related but distinct bug. It produces a similar symptom (an accepted edit that undo does not cover), but I have not yet confirmed the exact cause, so I am noting it here separately.
Steps to reproduce:
What you see: the caption reverts on the canvas, so Undo looks like it worked. But the modal still shows the alt text, caption, and description edits from step 3, unchanged.
The attachment edit is also saved immediately when the modal closes (a direct REST request), before Undo is ever pressed, so by the time Undo runs, the change is already persisted server-side.
I am still confirming the exact mechanism behind why undo does not cover the attachment's own edit. I will follow up once I have verified it.