File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
packages/block-editor/src/components/provider Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -104,15 +104,25 @@ export default function useBlockSync( {
104104 // and so it would already be persisted.
105105 __unstableMarkNextChangeAsNotPersistent ( ) ;
106106 if ( clientId ) {
107+ const blockName = getBlockName ( clientId ) ;
108+ const isPostContentBlock = blockName === 'core/post-content' ;
109+
107110 // It is important to batch here because otherwise,
108111 // as soon as `setHasControlledInnerBlocks` is called
109112 // the effect to restore might be triggered
110113 // before the actual blocks get set properly in state.
111114 registry . batch ( ( ) => {
112115 setHasControlledInnerBlocks ( clientId , true ) ;
113- const storeBlocks = controlledBlocks . map ( ( block ) =>
114- cloneBlock ( block )
115- ) ;
116+
117+ // For post-content block children, preserve the
118+ // original blocks to maintain UUIDs used for
119+ // multi-user collaboration
120+ //
121+ // Unsure: Why are these blocks being cloned? Do they need to be?
122+ const storeBlocks = isPostContentBlock
123+ ? controlledBlocks
124+ : controlledBlocks . map ( ( block ) => cloneBlock ( block ) ) ;
125+
116126 if ( subscribedRef . current ) {
117127 pendingChangesRef . current . incoming = storeBlocks ;
118128 }
You can’t perform that action at this time.
0 commit comments