Skip to content

RTC: Backport race condition fix#76649

Merged
chriszarate merged 2 commits intotrunkfrom
feat/wp-11292-backport
Mar 19, 2026
Merged

RTC: Backport race condition fix#76649
chriszarate merged 2 commits intotrunkfrom
feat/wp-11292-backport

Conversation

@chriszarate
Copy link
Copy Markdown
Contributor

@chriszarate chriszarate commented Mar 18, 2026

What?

Backport race condition fix from WordPress/wordpress-develop#11292

IMPORTANT: This should only be merged if we do not proceed with the custom table approach.

Why?

A race condition exists when applying compaction updates using the default polling provider.

@chriszarate chriszarate added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Mar 18, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

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: chriszarate <czarate@git.wordpress.org>
Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@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
Copy link
Copy Markdown

Flaky tests detected in f91d8e6.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23265816185
📝 Reported issues:

Copy link
Copy Markdown
Contributor

@alecgeatches alecgeatches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The meta_id-based logic looks correct, and in my local testing I didn't see any odd behavior during compaction. Any interest in moving the tests from WordPress/wordpress-develop#11292 over here?

@chriszarate
Copy link
Copy Markdown
Contributor Author

Any interest in moving the tests from WordPress/wordpress-develop#11292 over here?

Looks like we're inconsistent in doing so. It's a good suggestion, but might tackle post-RC1 since there could be conflicts with other work.

@chriszarate chriszarate merged commit b44dee0 into trunk Mar 19, 2026
42 checks passed
@chriszarate chriszarate deleted the feat/wp-11292-backport branch March 19, 2026 13:55
@github-actions github-actions bot added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Mar 19, 2026
gutenbergplugin pushed a commit that referenced this pull request Mar 19, 2026
* Backport race condition fix

* Add backport changelog entry
@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions bot added this to the Gutenberg 22.9 milestone Mar 19, 2026
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Mar 20, 2026
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.

The following changes are included:

- RTC: Backport race condition fix (WordPress/gutenberg#76649)
- Fix navigation block rendering unit test (WordPress/gutenberg#76685)
- Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512)
- RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704)
- Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659)
- Fix navigation block unit test and e2e test (WordPress/gutenberg#76692)
- Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710)
- Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718)
- Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591)
- Gate client-side media processing as plugin-only (WordPress/gutenberg#76700)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d.

Log created with:

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

See #64595.

git-svn-id: https://develop.svn.wordpress.org/trunk@62076 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Mar 20, 2026
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.

The following changes are included:

- RTC: Backport race condition fix (WordPress/gutenberg#76649)
- Fix navigation block rendering unit test (WordPress/gutenberg#76685)
- Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512)
- RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704)
- Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659)
- Fix navigation block unit test and e2e test (WordPress/gutenberg#76692)
- Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710)
- Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718)
- Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591)
- Gate client-side media processing as plugin-only (WordPress/gutenberg#76700)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d.

Log created with:

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

See #64595.
Built from https://develop.svn.wordpress.org/trunk@62076


git-svn-id: http://core.svn.wordpress.org/trunk@61358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 23, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 23, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 24, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
dmsnell pushed a commit to dmsnell/wordpress-develop that referenced this pull request Mar 26, 2026
See changelog in 0af3431

> Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`.
> The following changes are included:
>
> - RTC: Backport race condition fix (WordPress/gutenberg#76649)
@dsas dsas added Backport to Gutenberg Minor Release Pull request that needs to be backported to a Gutenberg minor release and removed Backport to Gutenberg Minor Release Pull request that needs to be backported to a Gutenberg minor release labels Mar 26, 2026
@dsas dsas modified the milestones: Gutenberg 22.9, Gutenberg 22.8 Mar 26, 2026
@dsas
Copy link
Copy Markdown
Contributor

dsas commented Mar 26, 2026

I just cherry-picked this PR to the release/22.8 branch to get it included in the next release: e09aa7f

dsas pushed a commit to dsas/gutenberg that referenced this pull request Mar 26, 2026
* Backport race condition fix

* Add backport changelog entry
ockham pushed a commit that referenced this pull request Mar 26, 2026
* Real Time Collaboration: Introduce filters for the polling intervals. (#76518)

* Introduce filters for the RTC polling intervals.

Introduces four filters for the polling intervals in the real time collaboration client:

* `sync.pollingManager.pollingIntervalNoCollaborators` the interval in milliseconds when there are no collaborators in the room
* `sync.pollingManager.pollingIntervalWithCollaborators` the interval in milliseconds when there are collaborators in the room

* Remove background tab interval filter

* Match filter to constant name

---------

Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>

* RTC: Fix RichTextData deserialization (#76607)

* Add failing unit test for RichTextData conversion

* Fix RichText attribute type via deserializeBlockAttributes() call in getPostChangesFromCRDTDoc()

* Add test for nested RichText value

* Modify deserializeAttributeValue() to recurse arrays and object, using block schema for deeply nested strings

* Remove deserializeBlockAttributeValues to avoid 3 different deserialization functions

* Add factory wrapper for rich text cache, testing

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

* RTC: Scroll to collaborator on click (#76561)

* Add createCursorRegistry factory and use it for scrolling to cursors

* Use createCursorRegistry for scrolling

* Localize spoken scroll to cursor announcement

* Merge two matching conditionals

* Use removeAll in cursor registry

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

* RTC: Change RTC option name (#76643)

* Change RTC option name

* Add backport changelog

* Restore option migration

* Cover previous option name in setCollaboration

* Respect previous value in setting injection

* Update migration const

* Temporary bridge

Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: sc0ttkclark <sc0ttkclark@git.wordpress.org>
Co-authored-by: maxschmeling <maxschmeling@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>

* RTC: Backport race condition fix (#76649)

* Backport race condition fix

* Add backport changelog entry

* RTC: Increase polling intervals, increase polling on primary room only (#76704)

* Bump polling intervals up by 4x

* Reset `hasCollaborators` flag on awareness check

* Use the first registered room as the primaryRoom, and only pay attention to awareness results from that entity to avoid poll increases from shared entities like categores

* Simplify primaryRoom and enforceConnectionLimit

* Fix the collaboration utility setup for collaboration tests

---------

Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

* RTC: Use activation hook to enable RTC by default (#76736)

* Use activation hook to enable RTC by default

* Fix plugin file reference

* Directly hook into the `activate_` function for enabling collaboration

* Add PR backport for opt-in change

---------

Co-authored-by: Alec Geatches <alec.geatches@automattic.com>

* RTC: Add E2E "stress test" with complex interactions (#76055)

* Add RTC E2E "stress test" with complex interactions

* Refactor collab utils to work for n users instead of just 2 users

* Attempting to fix the timeout, as well as the text insertion being slightly off

* insert the test rather than sequentially type it

* Respect the collaborators limit of 3

* Switch the type to insertText

* Remove refresh as that causes editor limit exceeded

* Check Gamma's movement

---------

Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>

* RTC: Use prepared queries instead of `*_post_meta` functions (#76779)


## What?

Use prepared queries instead of `*_post_meta` functions.

## Why?

Backport of WordPress/wordpress-develop#11325. Prevents post and post meta cache invalidation when RTC requests are handled.

- See: https://core.trac.wordpress.org/ticket/64696
- See: https://core.trac.wordpress.org/ticket/64916

* RTC: Remove stale wp_enable_real_time_collaboration option check (#76810)

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>

* RTC: Fix editor freeze when replacing code editor content (#76815)

* Add failing performance test for huge code editor changes

* Use diffLines() when strings are > 10_000 characters

* Handle diffLines in diffWithCursor() when cursor information is sent. We don't care about the cursor for huge performance-sensitive updates

* Explicitly use "primary" instead of "meta" key

* Revert "Explicitly use "primary" instead of "meta" key"

This reverts commit 33e7aba.

* Fix paste keys for CI, lower timeouts

* Remove console.log

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

* Preferences: Hide collaboration options when RTC is not enabled (#76819)

* Preferences: Hide collaboration options when RTC is not enabled

Only show the "Show avatar in blocks" and "Show collaboration
notifications" preference controls when real-time collaboration
is actually enabled for the current post.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Preferences: Consolidate editorStore select call

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>

* Fix navigation block rendering unit test (#76685)

* Fix navigation block rendering unit test

* Remove semicolon

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

* Fix navigation block unit test and e2e test (#76692)

* Fix navigation block rendering unit test (second try)

* Fix e2e test

* Revert unncessary change

---------

Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: Alec Geatches <alec.geatches@automattic.com>
Co-authored-by: alecgeatches <alecgeatches@git.wordpress.org>
Co-authored-by: ingeniumed <ingeniumed@git.wordpress.org>
Co-authored-by: Max Schmeling <max.schmeling@automattic.com>
Co-authored-by: maxschmeling <maxschmeling@git.wordpress.org>
Co-authored-by: Chris Zarate <chris.zarate@automattic.com>
Co-authored-by: sc0ttkclark <sc0ttkclark@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: Shekhar Wagh <shekharnwagh@gmail.com>
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
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 [Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants