Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 3 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 (24)

#1 @jorbin
5 months ago

Related tickets with commits that will need to be removed (possibly not exhaustive):

#64622
#64696
#64887
#64949
#65008
#64696
#64783
#64845
#64904
#64949

#2 @jorbin
5 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 @ellatrix
5 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.


5 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:


5 months ago
#5

I guess we need to decide whether to skip the unit tests, e.g., via markTestSkipped() or have a temp override for wp_is_collaboration_enabled in 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:


5 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:


5 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.


5 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 of if ( wp_is_collaboration_enabled() ) guards in shared files.
  • The JavaScript side was already detached in [62333] (Gutenberg now bundles @wordpress/sync rather than exposing wp.sync globally), 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 collaboration requires.
    • src/wp-includes/post.php: remove wp_sync_storage post-type and _crdt_document post-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 in wp_check_locked_posts() heartbeat handler.
    • src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php: revert update_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 the wp_collaboration_enabled option registration, default, and allowed-options entry.
    • src/wp-includes/default-filters.php: remove the wp_collaboration_inject_setting admin_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_enabled filters in tests/phpunit/tests/rest-api/rest-autosaves-controller.php; drop the wp_collaboration_enabled entry in tests/phpunit/tests/rest-api/rest-settings-controller.php; drop the two qunit fixture entries in tests/qunit/fixtures/wp-api-generated.js.

## Verification

  • php -l clean 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 in src/ or tests/ (the only hits are unrelated marketing prose in wp-admin/about.php and 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.


5 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

#10 @ellatrix
5 months ago

  • Owner set to ellatrix
  • Resolution โ†’ fixed
  • Status new โ†’ closed

In 62334:

Remove real-time collaboration.

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.

#11 @ellatrix
5 months ago

  • Keywords dev-feedback added
  • Resolution fixed
  • Status closed โ†’ reopened

This ticket was mentioned in โ€‹PR #11778 on โ€‹WordPress/wordpress-develop by โ€‹@desrosj.


5 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 @desrosj
5 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.

Last edited 5 months ago by desrosj (previous) (diff)

โ€‹@ellatrix commented on โ€‹PR #11778:


5 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:


5 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 the svn:mergeinfo)
  • Commit.

#16 @ellatrix
5 months ago

In 62337:

Properly delete RTC files after [62334].

Props desrosj.
See #65205.

โ€‹@maxschmeling commented on โ€‹PR #11778:


5 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:


5 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.

#19 @desrosj
5 months ago

  • Keywords dev-reviewed added; dev-feedback removed

[62334] and [62337] look good for backport. Handling that now.

#20 @desrosj
5 months ago

  • Resolution โ†’ fixed
  • Status reopened โ†’ closed

In 62338:

Remove real-time collaboration.

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.

Reviewed by desrosj.
Merges [62334], [62337] to the 7.0 branch.

Props maxschmeling, ellatrix, mukesh27.
Fixes #65205.

#21 @desrosj
3 months ago

In 62781:

General: Explicitly delete wp-includes/collaboration.

The contents of the src/wp-includes/collaboration directory were removed in [62337]. However, SVN requires the directory to also be deleted.

Props barry, johnbillion, jorbin, desrosj, sergeybiryukov.
See #65325, #65205.

#22 @desrosj
3 months ago

In 62782:

General: Periods and commas are not the same.

Follow up to [62777].

Props johnbillion, jorbin, desrosj.
See #65325, #65205.

#23 @desrosj
3 months ago

In 62783:

General: Note files that were readded for 7.1.

Props johnbillion, jorbin, desrosj, barry.
See #65325, #65205.

#24 @desrosj
3 months ago

In 62785:

General: Periods and commas are not the same.

Follow up to [62777].

Merges [62782] to the 7.0 branch.

Props johnbillion, jorbin, desrosj.
See #65325, #65205.

Note: See TracTickets for help on using tickets.