Skip to content

Real-time collaboration: Expand mergeCrdtBlocks() automated testing#75923

Merged
alecgeatches merged 2 commits intoWordPress:trunkfrom
Automattic:add/merge-crdt-blocks-tests
Feb 25, 2026
Merged

Real-time collaboration: Expand mergeCrdtBlocks() automated testing#75923
alecgeatches merged 2 commits intoWordPress:trunkfrom
Automattic:add/merge-crdt-blocks-tests

Conversation

@alecgeatches
Copy link
Contributor

What?

Adds edge-case testing to mergeCrdtBlocks().

Ported over some tests and a minor mergeCrdtBlocks() fix from a PR originally merged to wpvip/rtc-plugin #74304. Note that one of the tests "removes duplicate clientIds across different nesting levels" and associated changes weren't moved over to this new PR, as they required a more significant code change for an issue that is unlikely to be a problem.

Also fixes the new test "handles block type changes from non-rich-text to rich-text", which was failing when an attribute transitioned from a raw string to rich-text content when the string value was the same.

Why?

mergeCrdtBlocks() is a crucial part of our CRDT implementation in Gutenberg and adding more testing around it is a good idea.

How?

Previously we had a isRichText boolean specifically used for transforming rich-text attributes, but this pattern has been expanded. The isExpectedAttributeType() and updateYBlockAttribute() family of functions generally handle type-changing attributes in an extendable pattern that could apply to other attributes beyond rich-text.

Testing Instructions

To run the CRDT test suite:

npm run test:unit -- --testPathPattern=crdt-blocks

@alecgeatches alecgeatches requested a review from nerrad as a code owner February 25, 2026 18:07
@alecgeatches alecgeatches added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration labels Feb 25, 2026
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the [Package] Core data /packages/core-data label Feb 25, 2026
@alecgeatches alecgeatches force-pushed the add/merge-crdt-blocks-tests branch from 653128b to 2f841c2 Compare February 25, 2026 18:48
@chriszarate chriszarate added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Feb 25, 2026
@alecgeatches alecgeatches merged commit 128a3c2 into WordPress:trunk Feb 25, 2026
87 of 100 checks passed
@alecgeatches alecgeatches deleted the add/merge-crdt-blocks-tests branch February 25, 2026 22:17
@github-actions github-actions bot added this to the Gutenberg 22.7 milestone Feb 25, 2026
@github-actions github-actions bot removed the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Feb 25, 2026
gutenbergplugin pushed a commit that referenced this pull request Feb 25, 2026
…75923)

* Add tests for mergeCrdtBlocks() edge cases

* Separate type-specific attribute logic into updateYBlockAttribute(), fix test

Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
@github-actions github-actions bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Feb 25, 2026
@github-actions
Copy link

I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: a1350dd

pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Feb 26, 2026
CI run: #11059.

See #64595.

---

I've included a log of the Gutenberg changes with the following command:

git log --reverse --format="- %s" 23b566c72e9c4a36219ef5d6e62890f05551f6cb..022d8dd3d461f91b15c1f0410649d3ebb027207f | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

- Pattern Editing: Fix nested patterns/sections (WordPress/gutenberg#75772)
- QuickEdit: rename status label and remove extra labels in popup (WordPress/gutenberg#75824)
- Fix block editing modes not recomputing when isolated editor value changes (WordPress/gutenberg#75821)
- Synced patterns: Fix block editing mode of synced pattern content when nested in an unsynced pattern (WordPress/gutenberg#75818)
- Block Support: Fix custom CSS not saved when style schema is not defined (WordPress/gutenberg#75797)
- Gallery: Fixes keyboard focus escaping the lightbox overlay when navigating a gallery with Tab/Shift+Tab. (WordPress/gutenberg#75852)
- Navigation Overlay Close: Set Close as default text, rather than using a placeholder (WordPress/gutenberg#75692)
- RTC: Fix entity save call / initial persistence. (WordPress/gutenberg#75841)
- Real-time collaboration: Improve collaboration within the same rich text (WordPress/gutenberg#75703)
- Client Side Media: Add device/browser capability detection (WordPress/gutenberg#75863)
- Navigation editing: simplify edit/view buttons (WordPress/gutenberg#75819)
- Add core/icon block to theme.json schema (WordPress/gutenberg#75813)
- Fix error when undoing newly added pattern (WordPress/gutenberg#75850)
- Page List Item: Replace RawHTML with dangerouslySetInnerHTML for label and title (WordPress/gutenberg#75890)
- REST API: Make filter_wp_unique_filename() static to match core, plus avoid duplicate routes (WordPress/gutenberg#75782)
- RichText: useAnchor: Fix TypeError in virtual element (WordPress/gutenberg#75900)
- DataViews: Remove menu divider again. (WordPress/gutenberg#75908)
- Theme: Add build plugins to inject design token fallbacks (WordPress/gutenberg#75901)
- Theme: Remove global stylesheet (WordPress/gutenberg#75879)
- Real-time collaboration: Remove ghost awareness state explicitly when refreshing (WordPress/gutenberg#75883)
- Real-time collaboration: Expand mergeCrdtBlocks() automated testing (WordPress/gutenberg#75923)
- Fix client-side media file naming (WordPress/gutenberg#75817)
- Add: Connectors screen (WordPress/gutenberg#75833)
- Merge document meta into state map (WordPress/gutenberg#75830)
- Move WordPress meta key from sync package to core-data (WordPress/gutenberg#75846)
- Bugfix: Fix casing of getPersistedCRDTDoc (WordPress/gutenberg#75922)
- Add debug logging to SyncManager (WordPress/gutenberg#75924)
- DataForm: fix label colors (WordPress/gutenberg#75730)
- DataViews: minimize padding for primary action buttons (WordPress/gutenberg#75721) (WordPress/gutenberg#75947)
- Connectors: Add `_ai_` prefix to connector setting names and fix naming inconsistencies (WordPress/gutenberg#75948)
- Connectors: Unhook Core callbacks in Gutenberg coexistence (WordPress/gutenberg#75935)
- Unsynced patterns: Rename 'Disconnect pattern' to 'Detach pattern' in context menu (WordPress/gutenberg#75807)
- Editor: Remove View dropdown and pinned items from revisions header (WordPress/gutenberg#75951)
- Fix: Template revisions infinite spinner (WordPress/gutenberg#75953)
- Backport: Avoid flickering while refreshing (WordPress/gutenberg#74572) (WordPress/gutenberg#75952)
- Add wp_ prefix to real time collaberation option. (WordPress/gutenberg#75837)


git-svn-id: https://develop.svn.wordpress.org/trunk@61750 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Feb 26, 2026
CI run: WordPress/wordpress-develop#11059.

See #64595.

---

I've included a log of the Gutenberg changes with the following command:

git log --reverse --format="- %s" 23b566c72e9c4a36219ef5d6e62890f05551f6cb..022d8dd3d461f91b15c1f0410649d3ebb027207f | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

- Pattern Editing: Fix nested patterns/sections (WordPress/gutenberg#75772)
- QuickEdit: rename status label and remove extra labels in popup (WordPress/gutenberg#75824)
- Fix block editing modes not recomputing when isolated editor value changes (WordPress/gutenberg#75821)
- Synced patterns: Fix block editing mode of synced pattern content when nested in an unsynced pattern (WordPress/gutenberg#75818)
- Block Support: Fix custom CSS not saved when style schema is not defined (WordPress/gutenberg#75797)
- Gallery: Fixes keyboard focus escaping the lightbox overlay when navigating a gallery with Tab/Shift+Tab. (WordPress/gutenberg#75852)
- Navigation Overlay Close: Set Close as default text, rather than using a placeholder (WordPress/gutenberg#75692)
- RTC: Fix entity save call / initial persistence. (WordPress/gutenberg#75841)
- Real-time collaboration: Improve collaboration within the same rich text (WordPress/gutenberg#75703)
- Client Side Media: Add device/browser capability detection (WordPress/gutenberg#75863)
- Navigation editing: simplify edit/view buttons (WordPress/gutenberg#75819)
- Add core/icon block to theme.json schema (WordPress/gutenberg#75813)
- Fix error when undoing newly added pattern (WordPress/gutenberg#75850)
- Page List Item: Replace RawHTML with dangerouslySetInnerHTML for label and title (WordPress/gutenberg#75890)
- REST API: Make filter_wp_unique_filename() static to match core, plus avoid duplicate routes (WordPress/gutenberg#75782)
- RichText: useAnchor: Fix TypeError in virtual element (WordPress/gutenberg#75900)
- DataViews: Remove menu divider again. (WordPress/gutenberg#75908)
- Theme: Add build plugins to inject design token fallbacks (WordPress/gutenberg#75901)
- Theme: Remove global stylesheet (WordPress/gutenberg#75879)
- Real-time collaboration: Remove ghost awareness state explicitly when refreshing (WordPress/gutenberg#75883)
- Real-time collaboration: Expand mergeCrdtBlocks() automated testing (WordPress/gutenberg#75923)
- Fix client-side media file naming (WordPress/gutenberg#75817)
- Add: Connectors screen (WordPress/gutenberg#75833)
- Merge document meta into state map (WordPress/gutenberg#75830)
- Move WordPress meta key from sync package to core-data (WordPress/gutenberg#75846)
- Bugfix: Fix casing of getPersistedCRDTDoc (WordPress/gutenberg#75922)
- Add debug logging to SyncManager (WordPress/gutenberg#75924)
- DataForm: fix label colors (WordPress/gutenberg#75730)
- DataViews: minimize padding for primary action buttons (WordPress/gutenberg#75721) (WordPress/gutenberg#75947)
- Connectors: Add `_ai_` prefix to connector setting names and fix naming inconsistencies (WordPress/gutenberg#75948)
- Connectors: Unhook Core callbacks in Gutenberg coexistence (WordPress/gutenberg#75935)
- Unsynced patterns: Rename 'Disconnect pattern' to 'Detach pattern' in context menu (WordPress/gutenberg#75807)
- Editor: Remove View dropdown and pinned items from revisions header (WordPress/gutenberg#75951)
- Fix: Template revisions infinite spinner (WordPress/gutenberg#75953)
- Backport: Avoid flickering while refreshing (WordPress/gutenberg#74572) (WordPress/gutenberg#75952)
- Add wp_ prefix to real time collaberation option. (WordPress/gutenberg#75837)

Built from https://develop.svn.wordpress.org/trunk@61750


git-svn-id: http://core.svn.wordpress.org/trunk@61056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Core data /packages/core-data [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants