Opened 8 weeks ago
Last modified 10 days ago
#64622 reopened task (blessed)
Real-time collaboration: Add new REST endpoints, setting, and registered post meta
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch has-unit-tests add-to-field-guide needs-dev-note |
| Focuses: | Cc: |
Description
In Gutenberg, we have added support for real-time collaboration using CRDT documents (via the Yjs library). This work has suggested the following additions to WordPress:
- A default "sync provider" based on HTTP polling that allows collaborators to share updates with each other. Previously, we relied on WebRTC connections between collaborators for this purpose, but it proved unreliable under many network conditions.
- Our solution is designed to work on any WordPress installation.
- HTTP polling is the transport we identified as most likely to work universally.
- Given the isolation and lifecycle of PHP processes, updates must be stored centrally in order to be shared among peers. We have chosen to store updates in post meta against a special post type, but alternate storage mechanisms are possible.
- Collaborative editing can involve syncing multiple CRDT documents. To limit the number of connections consumed by this provider, requests are batched.
- To prevent unbounded linear growth, updates are periodically compacted.
- To avoid excessive load on lower-resourced hosts, this provider will benefit from usage limits (e.g., a maximum of three connected collaborators) enforced by the client (Gutenberg).
- A new registered post meta that allows Gutenberg to persist CRDT documents alongside posts.
- This provides all collaborators with a "shared starting point" for the collaborative session, which avoids duplicate updates.
- Content stored in the WordPress database always remains the source of truth. If the content differs from the persisted CRDT document, the CRDT document is updated to match the database.
- A new Writing setting that allows users to opt-in to real-time collaboration.
- Enabling real-time collaboration disables post lock functionality and connects users to the sync provider.
- A behavior change to autosaves is needed. When the the original author is editing a draft post (post_status == 'draft' OR 'auto-draft') and they hold the post lock, the autosave targets the actual post instead of an autosave revision. This puts the post data and the persisted CRDT document out of sync and leads to duplicate updates. When real-time collaboration is enabled, all collaborators must autosave in the same way.
This wordpress-develop PR provides a proposed implementation of the changes above, but discussion is no doubt needed:
https://github.com/WordPress/wordpress-develop/pull/10894
This corresponding Gutenberg PR moves the work from the experimental directory to lib/compat:
https://github.com/WordPress/gutenberg/pull/75366
Cumulative work to add this functionality can be found using this label:
Change History (74)
This ticket was mentioned in PR #10894 on WordPress/wordpress-develop by @czarate.
8 weeks ago
#1
- Keywords has-patch added
@paulkevan commented on PR #10894:
8 weeks ago
#2
Is there any tests we can add for the default provider and new functionality?
@paulkevan commented on PR #10894:
8 weeks ago
#3
Can we also provide some documentation on how to override the provider given it's known limitation listed above?
@czarate commented on PR #10894:
8 weeks ago
#4
Why isn't each room a post?
No strong reason. Mostly to avoid creating a large number of posts. Each room corresponds to a synced CRDT document (representing a WordPress entity). Currently supported entity types:
- posts (any post type)
- taxonomy collections
In the future, this could be expanded to include all database entities, including individual taxonomy terms. We might also create rooms to share awareness data at the page or screen level.
We intend to enforce limits on this default provider, but probably applied to simultaneous collaborators and not on the overall number of synced entities. Sharing a single post felt prudent but happy to reconsider! I know wp_postmeta#meta_key is indexed but I don't have a grasp on the performance tradeoff at large scale.
#5
@
8 weeks ago
A new Writing setting that allows users to opt-in to real-time collaboration.
This seems to go against both the Out of the box and Decisions, not options philosophy points. Can you share some of the rationale behind this?
#6
@
8 weeks ago
This seems to go against both the Out of the box and Decisions, not options philosophy points. Can you share some of the rationale behind this?
Real-time collaboration by default should be our goal. However, it's a significant change to how editing works, both for human workflows and for third-party integrations. We want to expose users to this valuable new feature while giving site administrators control in case they need time to update their processes or code.
Additionally, the default sync provider is designed to allow every WordPress installation the ability to use real-time collaboration. However, the ideal sync provider for a given installation may vary depending on its size, the number of active editors, and the capabilities of its host. Over time, we expect that hosts will implement their own sync providers, similar to how object caching works.
Given this, a top-level on/off setting seems like a useful control at this early stage of exposure—but temporary. At some point soon, we expect that the feature will be enabled by default and this control would be removed.
#7
@
8 weeks ago
At some point soon, we expect that the feature will be enabled by default and this control would be removed.
That point needs to happen before this is committed to core.
Also, when should we expect a merge proposal on make/core?
#8
@
7 weeks ago
I think the setting for RTC is probably the safest path forward. This is a big impactful feature. A way to disable the feature seems mandatory to me (either opt-in or opt-out). There's no possibility for RTC to work without issues entirely in all WordPress installs.
#9
@
7 weeks ago
Also, when should we expect a merge proposal on make/core?
Starting work on this and plan on having it ready to publish on Wednesday.
@paulkevan commented on PR #10894:
7 weeks ago
#11
Fix one of the failing unit tests here: https://github.com/chriszarate/wordpress-develop/pull/1 since I couldn't PR against this.
@czarate commented on PR #10894:
7 weeks ago
#12
Note that I've removed the commit that updates Gutenberg to the required version to allow unit tests to pass. The testing instructions have been updated accordingly.
gclapps0612-cmd commented on PR #10894:
7 weeks ago
#13
Thanks for the update George and please help me get the best account
partnered sponsor for your operations platform. I ALSO believe that my
keys and music are in the 2B but I'm not sure if the id is on me and if
free we're my in investments.? Thanks gclapps0612 has like 20 ids and many
# that are old. I love working in thus org but. I am confused because I
was compromised according to my report. And I am a 2004 space 5g 6g cancer
prototype for research but haven't been able to get my certs and doc. To
confirm electrical variance and sound sequence, to light and sound but I
am here trying. Thanks for not giving up on me
Forgive me for not telling you that I am so much better now that I am the
element ✨️ in lights on me. Are we done and if satellite id is the key ?
Beacon light
On Tue, Feb 17, 2026, 10:48 PM github-actions[bot] *@*.*>
wrote:
*github-actions[bot]* left a comment (WordPress/wordpress-develop#10894)
<https://github.com/WordPress/wordpress-develop/pull/10894#issuecomment-3918406241>
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.
Core Committers: Use this line as a base for the props when committing in
SVN:
Props czarate, paulkevan, timothyblynjacobs, westonruter.
*To understand the WordPress project's expectations around crediting
contributors, please review the Contributor Attribution page in the Core
Handbook
<https://make.wordpress.org/core/handbook/best-practices/contributor-attribution-props/>.*
—
Reply to this email directly, view it on GitHub
<https://github.com/WordPress/wordpress-develop/pull/10894#issuecomment-3918406241>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXZWJXC2PMKTI4QJG5Y6EEL4MPOI3AVCNFSM6AAAAACUSITQUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMJYGQYDMMRUGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: *@*.*>
@mindctrl commented on PR #10894:
7 weeks ago
#14
One of my first questions, which was already asked by @TimothyBJacobs, is related to the use of a single wp_sync_storage post.
Unless I'm misreading it, when add_post_meta, update_post_meta, and delete_post_meta are called, they invalidate all the cached meta for that post ID, but because every room shares the same wp_sync_storage post, that means all cached sync data across all rooms is invalidated. It's hard to understand why an editing session on post ID 1 should impact the caching and performance of a session on post ID 2.
In testing with 3 clients, I'm seeing thousands of post meta function calls within minutes. I think some of that could be alleviated by giving each room its own wp_sync_storage post, so that meta cache invalidation is scoped to a single session rather than all of them.
@czarate commented on PR #10894:
7 weeks ago
#15
In testing with 3 clients, I'm seeing thousands of post meta function calls within minutes. I think some of that could be alleviated by giving each room its own
wp_sync_storagepost, so that meta cache invalidation is scoped to a single session rather than all of them.
That's great feedback, thank you. I'll explore using separate posts in a new PR based on this one.
@czarate commented on PR #10894:
7 weeks ago
#16
@mindctrl, I've implemented your suggestion in this PR. cc @TimothyBJacobs
#17
@
6 weeks ago
Let's try opt-out during the beta cycle for maximum testing. Discussed this with @matveb, @annezazu, and the contributors involved. We can leave the option present in case beta users need to disable it and so we have an easy way to flip the switch back at any point in the cycle.
#18
@
6 weeks ago
- Owner set to ellatrix
- Resolution set to fixed
- Status changed from new to closed
In 61689:
This ticket was mentioned in PR #10979 on WordPress/wordpress-develop by @czarate.
6 weeks ago
#20
Increase $wp_db_version since the schema was changed in https://github.com/WordPress/wordpress-develop/pull/10894
Trac ticket: https://core.trac.wordpress.org/ticket/64622
The new option is set by populate_options(), which is only called during an upgrade.
This ticket was mentioned in PR #10980 on WordPress/wordpress-develop by @czarate.
6 weeks ago
#22
- Keywords has-unit-tests added
Fix autosave controller tests, which began failing when RTC was changed to enabled by default. The tests now need to cover two different code paths:
Trac ticket: https://core.trac.wordpress.org/ticket/64622
## Use of AI Tools
Partially generated by Claude Code
This ticket was mentioned in PR #10981 on WordPress/wordpress-develop by @alecgeatches.
6 weeks ago
#24
Backport fix for "Disconnected" dialog in the site editor when real-time collaboration is enabled. See related Gutenberg fix in https://github.com/WordPress/gutenberg/pull/75746:
## What?
When comments are a part of the post template, the site editor will show a "Disconnected" dialog when real-time collaboration is enabled:
This can be replicated by:
- Disable RTC via WordPress Admin -> Settings -> Writing, and uncheck the "Enable real-time collaboration" checkbox. Click the "Save Changes" button.
- Go to WordPress Admin -> Appearance -> Editor.
- Edit the post template to include comments and then click "Save":
https://github.com/user-attachments/assets/e097b9b5-63f1-4b6f-b9f3-741deb718cff
- Re-enable RTC.
- Go back to the appearance editor and wait a bit.
- See the "Disconnected" dialog above.
## Why?
When comments are present on the site editor page, we request entity rooms for individual comments loaded on the page, like
root/comment:1,root/comment:2, etc. Due to the fact that these have specified object IDs, this part of the code returnsfalseand returns a401to the user, triggering the dialog.
## How?
The fix here adds a special case for comments with specified IDs and does a special check against the comment. This isn't particularly robust for other special cases we may run into, but it does allow subscriptions to individual comment rooms.
#26
@
6 weeks ago
After some discussion with some of the release team and people involved, we decided it's better to make it opt-in during Beta 1 to allow more time for testing and iron out kinks.
This ticket was mentioned in PR #10982 on WordPress/wordpress-develop by @czarate.
6 weeks ago
#27
Revert the changes that enabled RTC by default for WP 7.0 Beta 1 per this comment.
- This improves and preserves the unit tests for
WP_REST_Autosaves_Controllerso that they pass whether the feature is enabled or not. - Since the REST API endpoints are conditionally registered, the QUnit fixtures must be updated.
@paulkevan commented on PR #10982:
6 weeks ago
#28
We'll need to bump $wp_db_version again once this lands.
@ellatrix commented on PR #10982:
6 weeks ago
#30
We'll need to bump $wp_db_version again once this lands.
@pkevan Do we? We already did a bump that will have caused the option to be populated. Once it's populated, a further bump will not do anything? Those who triggered the DB upgrade will have it enabled by default, but they can turn it off in settings. Those who hadn't upgraded yet will get it disabled by default? Or is this incorrect?
@paulkevan commented on PR #10982:
6 weeks ago
#31
We'll need to bump $wp_db_version again once this lands.
@pkevan Do we? We already did a bump that will have caused the option to be populated. Once it's populated, a further bump will not do anything? Those who triggered the DB upgrade will have it enabled by default, but they can turn it off in settings. Those who hadn't upgraded yet will get it disabled by default? Or is this incorrect?
yeah I was confused - ignore me 😄
#34
@
6 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened
Since WordPress 5.8.0, all new options have been prefixed with wp_ in the spirit of prefixing all the things to avoid the potential for conflict.
It would be good to rename the option from enable_real_time_collaboration to wp_enable_real_time_collaboration to continue this practice.
PR incoming.
This ticket was mentioned in PR #11001 on WordPress/wordpress-develop by @peterwilsoncc.
6 weeks ago
#35
Renames the option enable_real_time_collaboration to wp_enable_real_time_collaboration to follow convention since WordPress 5.8 to prefix new core options with wp.
Trac ticket: https://core.trac.wordpress.org/ticket/64622#comment:34
## Use of AI Tools
Nil.
@peterwilsoncc commented on PR #11001:
6 weeks ago
#36
Noting only that changing the option name will turn off real-time collaboration for anyone who has turned it on previously using the beta 1 release. (I think this is fine.)
Yeah, I'm fine with that too as it hasn't been in a production version.
For the associated Gutenberg PR, I've included a migration because the feature has been active in the plugin for a little longer. https://github.com/WordPress/gutenberg/pull/75837
@peterwilsoncc commented on PR #11001:
6 weeks ago
#38
This ticket was mentioned in PR #11049 on WordPress/wordpress-develop by @alecgeatches.
6 weeks ago
#39
Backport of PHP changes from https://github.com/WordPress/gutenberg/pull/75883. Changes the real-time collaboration polling server endpoint to accept null for awareness values, which is used to explicitly disconnect users leaving the page and remove their awareness data more quickly.
Trac ticket: https://core.trac.wordpress.org/ticket/64622
## Use of AI Tools
Claude for the original PR.
This ticket was mentioned in PR #11125 on WordPress/wordpress-develop by @shekharnwagh.
5 weeks ago
#41
Backport for awareness timeout update from Gutenberg PR - https://github.com/WordPress/gutenberg/pull/76065
Trac: https://core.trac.wordpress.org/ticket/64622
The 30 s awareness timeout matched the background-tab polling interval exactly, causing awareness entries to expire between polls and triggering false "X has left" notifications that resolved on the next poll cycle.
Increase to 70 s to comfortably exceed the polling interval. The value accounts for Chrome's intensive throttling which can delay background tab timers to ~60 s
@shekharnwagh commented on PR #11125:
5 weeks ago
#42
This is no longer required. We went with adjusting the polling interval when tab is in background which does not require backport PR - https://github.com/WordPress/gutenberg/pull/76065/changes/9daebb68bac8682b84ad9db09b4885e7f398a1e7
#43
@
5 weeks ago
- Keywords add-to-field-guide needs-dev-note added
This is worth mentioning in the Field Guide.
Also adding needs-dev-note just in case we can mention it in a more general note.
#45
@
5 weeks ago
We're reopening this ticket because we want to try enabling it by default for Beta 3.
This ticket was mentioned in PR #11159 on WordPress/wordpress-develop by @czarate.
5 weeks ago
#46
Trac ticket: https://core.trac.wordpress.org/ticket/64622
Enable RTC by default (opt-out). This reverses a previous decision for WP 7.0 Beta 1 to keep it opt-in. Note that any installation previously running a WP 7.0 beta will continue to have RTC disabled unless the database is re-initialized.
#48
follow-up:
↓ 49
@
5 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened
I'm of the view that negative option names are a bad idea as they add cognitive load for developers. Code needs to be written as if ( ! $thing ) then { enable() } whereas if ( $thing ) { enable() } is significantly easier to parse while reading or writing code.
The default option schema also includes options that are falsey by default, eg allowing registration of users, the use of pages for the blog listing, privacy page IDs, etc. I think it best to continue previous practices.
I'd like to revert r61828 and simply change the option default value if that's the desired change.
#49
in reply to:
↑ 48
@
5 weeks ago
Replying to peterwilsoncc:
I'd like to revert r61828 and simply change the option default value if that's the desired change.
I tend to agree with this reasoning.
#50
@
5 weeks ago
I'd like to revert r61828 and simply change the option default value if that's the desired change.
The desired change is a bit more complex:
Enable RTC by default for everyone:
- Even those that may have previously visited Settings > Writing and clicked save (for any reason).
- Even on hosts that do not run upgrade routines. (https://wordpress.slack.com/archives/C18723MQ8/p1771506588384619)
Point 1 requires that we change the option name or write a migration.
Point 2 strongly suggests that we remove the option from schema.php so that we don't run into this trouble again (if we decide to switch back to opt-out for final release). Instead we can rely on passing a default value to get_option.
I agree with the cognitive overload of default-negative options.
This ticket was mentioned in PR #11161 on WordPress/wordpress-develop by @peterwilsoncc.
5 weeks ago
#51
Enable Real Time Collaboration by default.
Trac ticket: https://core.trac.wordpress.org/ticket/64622
- Reverts option name change
- Adds filter so default value of the option is true.
## Use of AI Tools
None.
#52
@
5 weeks ago
I've created PR#11161:
- Reverts the commit above
- Sets the default option value in
populate_optionsto enable the feature - Adds a default filter to
default_option_wp_enable_real_time_collaborationto enable the feature without requiring the upgrade routine to run.
@czarate The PR covers item two with the default filter. Item one isn't a concern as it's a new feature so it's not possible for users of production software to have the RTC option set to zero.
My weakly held preference for upgraded sites is to only enable the feature by default for multi author blogs as there is less benefit for such sites to have RTC enabled.
#53
@
5 weeks ago
Thanks for working on this.
Item one isn't a concern as it's a new feature so it's not possible for users of production software to have the RTC option set to zero.
If our goal is wider testing, it's unfortunate that users of previous WP 7.0 beta releases may continue to have the RTC option set to zero.
@peterwilsoncc commented on PR #11161:
5 weeks ago
#54
@chriszarate Actually ready for review now... I'd missed that the filter in the tests preflighting the option to off needed to use __return_zero for it to actually work due to this code:
This ticket was mentioned in PR #11181 on WordPress/wordpress-develop by @alecgeatches.
4 weeks ago
#56
Backport https://github.com/WordPress/gutenberg/pull/76223.
Disable real-time collaboration on the site editor. In performance tests, editing large documents in the site-editor suite (loading large-post.html) can cause performance tests in the site editor to time out with memory errors. This eventually times out the entire performance testing suite in CI, blocking Gutenberg PRs from merging.
Until the root issue is resolved, temporarily disable RTC on the site editor to allow performance tests to pass until we resolve the root cause.
We may not need this PR, or the original Gutenberg PR if alternate fix https://github.com/WordPress/gutenberg/pull/76224 is successful.
#57
@
4 weeks ago
I disagree. People who already have the beta install will now NOT have RTC on by default, so we lose a lot of testing. I don't get your concern at all. Why are we optimizing for avoiding a negation? Additionally you're now requiring an upgrade to run whereas before we didn't. So you're also optimizing for avoiding a negation rather than optimizing for avoiding the user having to run an upgrade and additional testing?
Also @dd32 suggested using the second parameter of get_option to set the default rather than an upgrade. https://wordpress.slack.com/archives/C18723MQ8/p1772646049016559?thread_ts=1771506588.384619&cid=C18723MQ8
This ticket was mentioned in Slack in #core-committers by ella. View the logs.
4 weeks ago
#60
@
4 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening this for tracking purposes because it seems like there are still some questions/disagreements, so I'm unclear as to whether this is actually completed/fixed.
[61864] fixed an edge case where the editor became unusable when the wp_enable_real_time_collaboration option was missing from the database. However, if the option goes missing for some other reason, then that edge case still occurs. There is some further discussion on the other ticket, so I'll leave that on #64824.
@alecgeatches commented on PR #11181:
4 weeks ago
#61
@mukeshpanchal27 @ellatrix Thank you for the feedback, I've updated this PR accordingly.
This ticket was mentioned in Slack in #hosting by amykamala. View the logs.
4 weeks ago
This ticket was mentioned in PR #11234 on WordPress/wordpress-develop by @maxschmeling.
4 weeks ago
#63
Backport https://github.com/WordPress/gutenberg/pull/76322.
When RTC is enabled, the post list should not show an exclusive lock icon or user-specific lock text since multiple users can collaboratively edit the same post.
@shekharnwagh commented on PR #11234:
2 weeks ago
#65
I tried testing it locally and I can still see the post lock modal.
Followed this instructions to run it locally -
npm install npm run build:dev npm run env:start npm run env:install
@shekharnwagh commented on PR #11234:
2 weeks ago
#66
I tried testing it locally and I can still see the post lock modal. Followed this instructions to run it locally -
npm install npm run build:dev npm run env:start npm run env:install
Updating the branch fixed it. It was related to change in option name in #11289
@shekharnwagh commented on PR #11234:
2 weeks ago
#67
Looks good to me, approved 🚢
@maxschmeling commented on PR #11234:
2 weeks ago
#68
@mcsf do you mind giving the updates in https://github.com/WordPress/wordpress-develop/pull/11234/commits/fb00824dd7f75df7a036018c23368b30f0632ede a look? I haven't added translators notes / context in Core before, so maybe not the right style or something. Let me know.
@mcsf commented on PR #11234:
2 weeks ago
#69
@mcsf do you mind giving the updates in fb00824 a look? I haven't added translators notes / context in Core before, so maybe not the right style or something. Let me know.
Thanks, @maxschmeling, I've commented on one thing, but everything else looks good
@ellatrix commented on PR #11234:
2 weeks ago
#71
This is committed
This ticket was mentioned in PR #11346 on WordPress/wordpress-develop by @shekharnwagh.
12 days ago
#72
When RTC is enabled, the "Join" action link on the post list gets stuck after the post lock expires. The heartbeat correctly clears the lock status text and CSS class, but the link text was rendered server-side at page load and never updated back to "Edit".
Root cause: PR #11234 conditionally rendered "Join" or "Edit" based on wp_check_post_lock() at page load. The heartbeat JS updates the lock class and status text but has no code to swap the action link.
Fix: Always render both "Edit" and "Join" as separate <span> elements and toggle visibility via CSS using the .wp-collaborative-editing class the heartbeat already manages. Also replaces aria-label with screen-reader-text spans so the accessible name stays in sync with the visible text across lock state changes.
Trac ticket: https://core.trac.wordpress.org/ticket/64622
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.6
Used for: Investigating the heartbeat/lock mechanism, identifying the root cause, and implementing the fix. All changes were reviewed by me.
## Description
Trac ticket: https://core.trac.wordpress.org/ticket/64622
In Gutenberg, we have added support for real-time collaboration using CRDT documents (via the Yjs library). This work has suggested the following additions to WordPress:
This PR provides a proposed implementation of the changes above. This corresponding Gutenberg PR moves the work from the
experimentaldirectory tolib/compat:https://github.com/WordPress/gutenberg/pull/75366
Cumulative work to add this functionality can be found using this label:
https://github.com/WordPress/gutenberg/issues?q=label%3A%22%5BFeature%5D%20Real-time%20Collaboration%22%20is%3Apr
## Testing instructions