Opened 2 months ago
Closed 2 months ago
#65205 closed task (blessed) (fixed)
Remove Real Time Collaboration from WordPress Core
| Reported by: | jorbin | Owned by: | ellatrix |
|---|---|---|---|
| Priority: | highest omg bbq | Milestone: | 7.0 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests fixed-major commit dev-reviewed |
| Cc: | Focuses: |
Description
Per @matt, RTC is not shipping with 7.0 and the code associated with it needs to be removed.
See messages starting at https://wordpress.slack.com/archives/C07NVJ51X6K/p1778196273902419
Change History (20)
#2
@
2 months ago
The second piece of this work will be removing all of the code from Gutenbeg so when the hash is updated, none of the client side RTC code ships with core.
#3
@
2 months ago
I'm handling the GB in https://github.com/WordPress/gutenberg/pull/78085 (removing wp.sync exposure by bundling the sync script in core-data) and https://github.com/WordPress/wordpress-develop/pull/11760 (syncing GB). This will not disable RTC, that part will have to be done in core itself. I believe the consensus is to leave RTC code in GB in place and disable RTC, maybe add additional guards later if needed.
This ticket was mentioned in PR #11768 on WordPress/wordpress-develop by @maxschmeling.
2 months ago
#4
- Keywords has-patch added
https://core.trac.wordpress.org/ticket/65205
Force wp_is_collaboration_enabled() to always return false, remove the Collaboration control from Writing Settings, and stop accepting that option via options.php. Use wp_is_collaboration_enabled() for admin post list and heartbeat lock checks so UI matches the disabled collaboration API.
This effectively removes RTC from WP 7 without actually removing the code. This keeps us from making a lot of changes late in the release process and leaves the code in place which will be needed later anyways.
AI assistance: Yes
Tool(s): Cursor,
Model(s): Opus 4.6
Used for: All of it
@maxschmeling commented on PR #11768:
2 months ago
#5
I guess we need to decide whether to skip the unit tests, e.g., via
markTestSkipped()or have a temp override forwp_is_collaboration_enabledin the tests so that they pass?
I pushed e72e0ba with the latter. We'll need to decide if that is how we want to go about it.
@ellatrix commented on PR #11768:
2 months ago
#6
Isn't core RTC code seems easier and safer to pull out than GB RTC code? TBH unlike GB core I lean more towards reverting all the core code.
@maxschmeling commented on PR #11768:
2 months ago
#7
Isn't core RTC code seems easier and safer to pull out than GB RTC code? TBH unlike GB core I lean more towards reverting all the core code.
This PR represents the safest path in my opinion. But it's probably not a terrible route to remove it all either. I'm working on another PR for that approach and we can choose.
This ticket was mentioned in PR #11775 on WordPress/wordpress-develop by @ellatrix.
2 months ago
#8
- Keywords has-unit-tests added
## Summary
- Alternative to #11768. That PR force-disables RTC for 7.0 while leaving the code in place; this PR removes the code entirely.
- Net change: 21 files, +31 / -3,507. Seven files deleted (the sync server, sync storage, storage interface, the entry point at
src/wp-includes/collaboration.php, plus three test files), the rest are surgical edits to unwind RTC branches in shared code paths (post list table lock UI, autosaves controller, heartbeat handler, settings/options registration, REST API bootstrap).
## Why removal is feasible
- The PHP RTC surface was self-contained: a dedicated
src/wp-includes/collaboration/directory plus a small set ofif ( wp_is_collaboration_enabled() )guards in shared files. - The JavaScript side was already detached in [62333] (Gutenberg now bundles
@wordpress/syncrather than exposingwp.syncglobally), so no JS coordination is needed for this PR. - Reverting
WP_REST_Autosaves_Controller::create_item()to the pre-RTC author-draft logic, and reverting the post-list lock UI to its pre-RTC display, are mechanical (the original code is still recoverable from git history if RTC returns).
## What's removed
- Files:
src/wp-includes/collaboration.php;src/wp-includes/collaboration/{interface-wp-sync-storage,class-wp-sync-post-meta-storage,class-wp-http-polling-sync-server}.php;tests/phpunit/tests/rest-api/rest-sync-server.php;tests/phpunit/tests/collaboration/. - Edits:
src/wp-settings.php: drop the four collaborationrequires.src/wp-includes/post.php: removewp_sync_storagepost-type and_crdt_documentpost-meta registrations.src/wp-admin/includes/class-wp-posts-list-table.php: revert lock display, CSS class, and Edit/Join row action to the pre-RTC versions.src/wp-admin/includes/misc.php: remove RTC branch inwp_check_locked_posts()heartbeat handler.src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php: revertupdate_item()to the pre-RTC author-draft logic.src/wp-admin/options-writing.php: remove the Collaboration settings row.src/wp-admin/options.php,src/wp-admin/includes/schema.php,src/wp-includes/option.php: remove thewp_collaboration_enabledoption registration, default, and allowed-options entry.src/wp-includes/default-filters.php: remove thewp_collaboration_inject_settingadmin_init hook.src/wp-includes/rest-api.php: remove the conditional sync-server route registration.- Tests: drop the two RTC-specific autosave tests and
pre_option_wp_collaboration_enabledfilters intests/phpunit/tests/rest-api/rest-autosaves-controller.php; drop thewp_collaboration_enabledentry intests/phpunit/tests/rest-api/rest-settings-controller.php; drop the two qunit fixture entries intests/qunit/fixtures/wp-api-generated.js.
## Verification
php -lclean on every edited file.- Final grep for
collaboration/wp-sync/wp_sync/crdt/wp_collaboration/WP_ALLOW_COLLABORATION/wp_is_collaboration/WP_HTTP_Polling_Sync_Server/WP_Sync_*finds no remaining references insrc/ortests/(the only hits are unrelated marketing prose inwp-admin/about.phpand the Twenty Twenty starter content).
## Test plan
- [ ] Full PHPUnit suite passes on PHP 7.4 / 8.x.
- [ ] qunit suite passes after the fixture update.
- [ ] Smoke test post list lock display: open a post in a second browser, verify the locked-by-name UI shows in the post list and via heartbeat.
- [ ] Smoke test autosave: confirm same-author drafts continue to autosave directly to the post (pre-RTC behaviour) when no lock is held, and create autosave revisions otherwise.
- [ ] Verify Settings > Writing no longer shows the Collaboration row and that saving the page still works.
Trac: https://core.trac.wordpress.org/ticket/65205
🤖 Generated with Claude Code
This ticket was mentioned in PR #11774 on WordPress/wordpress-develop by @maxschmeling.
2 months ago
#9
https://core.trac.wordpress.org/ticket/65205
Alternate approach to https://github.com/WordPress/wordpress-develop/pull/11768
Delete collaboration bootstrap, sync storage, polling sync REST routes, and the wp_sync_storage post type plus _crdt_document meta registration.
Strip Writing Settings and REST settings registration for wp_collaboration_enabled, revert autosaves/post list/admin heartbeat behavior to classic non-collaborative flows, and simplify inline-edit-post locks CSS.
Remove PHPUnit tests for sync storage and RTC autosave behavior; update REST settings and QUnit fixture expectations.
AI assistance: Yes
Tool(s): Cursor
Model(s): Opus 4.6
This ticket was mentioned in PR #11778 on WordPress/wordpress-develop by @desrosj.
2 months ago
#12
Stages the backport to the 7.0 branch to resolve merge conflicts
Removes all RTC related code from core. There will still be RTC related code in Gutenberg, but effectively disabled for core since nothing turns it on. The wp.sync global has also been hidden by bundling in https://github.com/WordPress/gutenberg/pull/78085.
Developed in: https://github.com/WordPress/wordpress-develop/pull/11774.
Props maxschmeling, ellatrix, mukesh27.
Fixes #65205.
Trac ticket: Core-65205.
## Use of AI Tools
#13
@
2 months ago
- Keywords fixed-major commit added
Adding fixed-major commit so this one shows up in the correct group for reports organized by workflow (such as tickets/major/workflow.
It looks like this does not merge backwards to the 7.0 branch cleanly. I've created a pull request to work through the merge conflict.
@ellatrix commented on PR #11778:
2 months ago
#14
Oh, @maxschmeling's branch initially targeted the 7.0 branch, I didn't realize there might be conflicts.
@desrosj commented on PR #11778:
2 months ago
#15
Oh, @maxschmeling's branch initially targeted the 7.0 branch, I didn't realize there might be conflicts.
@maxschmeling can you confirm that everything looks good in trunk? If it does, then the process we can follow to backport this one can be:
- Checkout
branches/7.0 - Run
npm run grunt patch:URLOFORIGINALPRWITH7.0ASBASE svn merge -c 62334 --record-only(this will not attempt to actually merge the changes, it only updates thesvn:mergeinfo)- Commit.
@maxschmeling commented on PR #11778:
2 months ago
#17
@maxschmeling can you confirm that everything looks good in
trunk?
As far as I can tell it is. I tested the PR with the removal. Everything looked good there. And it appears to be applied to trunk correctly.
@maxschmeling commented on PR #11778:
2 months ago
#18
@maxschmeling can you confirm that everything looks good in
trunk?
As far as I can tell it is. I tested the PR with the removal. Everything looked good there. And it appears to be applied to trunk correctly.
I've tested trunk and had Opus take a look too. Not seeing any problems.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related tickets with commits that will need to be removed (possibly not exhaustive):
#64622
#64696
#64887
#64949
#65008
#64696
#64783
#64845
#64904
#64949