Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
85be643
Collaboration: Add dedicated database table and storage backend
josephfusco Mar 16, 2026
a4f8b98
Collaboration: Replace sync server with collaboration server
josephfusco Mar 16, 2026
da8317c
Collaboration: Remove legacy post meta storage and post type
josephfusco Mar 16, 2026
b06269e
Collaboration: Wire up bootstrap, feature gate, and cron cleanup
josephfusco Mar 16, 2026
886f0b1
Tests: Add collaboration server tests and remove legacy sync tests
josephfusco Mar 16, 2026
6827989
Collaboration: Use persistent object cache for awareness reads
josephfusco Mar 16, 2026
9bcbfe6
Tests: Fix REST schema and multisite test failures
josephfusco Mar 16, 2026
09d0b86
Tests: Remove erroneous connector fixtures from merge artifact
josephfusco Mar 16, 2026
7455141
Collaboration: Rename update_value column to data
josephfusco Mar 17, 2026
d4e27d4
Collaboration: Add type_client_id index and bump db_version
josephfusco Mar 17, 2026
ef00730
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 17, 2026
9b45174
Collaboration: Add payload limit constants and request validation
josephfusco Mar 17, 2026
dd319b8
Collaboration: Harden entity permission checks
josephfusco Mar 17, 2026
cd4a69f
Collaboration: Add tests for payload limits and permission hardening
josephfusco Mar 17, 2026
442798f
Collaboration: Apply coding standards and clarifications to table sto…
josephfusco Mar 17, 2026
2e7c177
Collaboration: Clean up stale data and unschedule cron when disabled
josephfusco Mar 17, 2026
24f4fdc
Collaboration: Remove backward-compatible wp-sync/v1 route alias
josephfusco Mar 17, 2026
14ba560
Collaboration: Move implementation details from docblock to code comment
josephfusco Mar 17, 2026
318051f
Collaboration: Remove deprecated wp-sync/v1 route test
josephfusco Mar 17, 2026
543bc6b
Collaboration: Add test for client ID reactivation after awareness ex…
josephfusco Mar 17, 2026
ba4ab78
Revert "Collaboration: Remove deprecated wp-sync/v1 route test"
josephfusco Mar 17, 2026
d833d2f
Revert "Collaboration: Remove backward-compatible wp-sync/v1 route al…
josephfusco Mar 17, 2026
030bbce
Collaboration: Harden storage layer, fix duplicate awareness rows, an…
josephfusco Mar 18, 2026
a5d543d
Collaboration: Add missing maxItems to REST schema fixture
josephfusco Mar 18, 2026
85b7491
Collaboration: Rename remove_updates_up_to_cursor to remove_updates_t…
josephfusco Mar 18, 2026
45c639a
Collaboration: Fix PHPCS alignment warnings in tests
josephfusco Mar 18, 2026
0d3d425
Collaboration: Fix REST schema fixture property order
josephfusco Mar 18, 2026
d812496
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 18, 2026
20131ec
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 18, 2026
52fc395
Apply suggestion from @peterwilsoncc
josephfusco Mar 19, 2026
1ef60f8
Update src/wp-includes/collaboration/class-wp-collaboration-table-sto…
josephfusco Mar 19, 2026
a988544
Update src/wp-includes/collaboration.php
josephfusco Mar 19, 2026
1a61f33
Collaboration: Merge upstream trunk and adopt wp_collaboration_enable…
josephfusco Mar 19, 2026
92fdc53
Collaboration: Fix test setup for opt-in default
josephfusco Mar 19, 2026
e7ac605
Collaboration: Add tests for cursor uniqueness, LIKE queries, and typ…
josephfusco Mar 19, 2026
a53685f
Collaboration: Add HTTP method rejection and request validation tests
josephfusco Mar 19, 2026
b55f3ce
Collaboration: Harden tests with exact assertions and split multi-sce…
josephfusco Mar 19, 2026
d4ea091
Collaboration: Fix PHPCS errors in tests
josephfusco Mar 19, 2026
6332302
Collaboration: Merge upstream trunk including post meta race conditio…
josephfusco Mar 19, 2026
cc24661
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 19, 2026
0be5c73
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 19, 2026
5f320b6
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 19, 2026
7bd3079
Collaboration: Add test proving sync writes do not invalidate awarene…
josephfusco Mar 19, 2026
68f2a62
Merge branch 'trunk' into collaboration/single-table
josephfusco Mar 20, 2026
4ccf903
Collaboration: Bucket awareness timestamps to 5-second intervals
josephfusco Mar 20, 2026
78ffe6f
Merge branch 'collaboration/single-table' of github.com:josephfusco/w…
josephfusco Mar 20, 2026
fb48ce3
Merge branch 'trunk' into feature/sync-updates-table
josephfusco Mar 31, 2026
465f1ba
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 1, 2026
8ae6d5a
Collaboration: Add input validation, compaction test, and remove old …
josephfusco Apr 1, 2026
0298cdd
Tests: Add compaction test for integer client IDs
josephfusco Apr 1, 2026
05e48e9
Collaboration: Fix compactor nomination for integer client IDs
josephfusco Apr 1, 2026
4df841c
Tests: Fix PHPCS coding standards in collaboration tests
josephfusco Apr 1, 2026
e724afb
Tests: Update REST API fixture for client_id schema changes
josephfusco Apr 1, 2026
870e4e0
Tests: Skip collaboration E2E tests when JS runtime is unavailable
josephfusco Apr 1, 2026
3b0be0b
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 1, 2026
ac5db07
Merge remote-tracking branch 'origin/trunk' into collaboration/single…
josephfusco Apr 2, 2026
f2730e7
Update src/wp-includes/collaboration/class-wp-collaboration-table-sto…
josephfusco Apr 10, 2026
8371c5c
Collaboration: Cap client_id at the storage column width.
josephfusco Apr 10, 2026
6e27b56
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 10, 2026
8ee5220
Collaboration: Add (room, type, date_gmt) index to the collaboration …
josephfusco Apr 10, 2026
961be20
Merge branch 'collaboration/single-table' of github.com:josephfusco/w…
josephfusco Apr 10, 2026
780f859
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 10, 2026
d549a14
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 13, 2026
cec47ab
Merge branch 'trunk' into collaboration/single-table
josephfusco Apr 16, 2026
d95a339
Update tests/qunit/fixtures/wp-api-generated.js.
peterwilsoncc Apr 16, 2026
f71e9a9
Merge branch 'trunk' into collaboration/table-awareness-object-cache
peterwilsoncc Apr 19, 2026
e1e6a88
Do not use table for awareness with persistent object cache.
peterwilsoncc Apr 20, 2026
d6dabe7
Reduce granuality to 10seconds, introduce filter.
peterwilsoncc Apr 20, 2026
facd672
Merge branch 'trunk' into collaboration/table-awareness-object-cache
peterwilsoncc Apr 20, 2026
fc45642
Skip tests that require an object cache not be in use for memcached r…
peterwilsoncc Apr 20, 2026
260773d
Filter options rather than update.
peterwilsoncc Apr 20, 2026
59cfe4e
Reset REST server intance to avoid breaking tests.
peterwilsoncc Apr 20, 2026
13d4f2f
Why did the tests fail to run?
peterwilsoncc Apr 20, 2026
2e35aa2
Use in-memory cache for awarenss when persistent cache isn’t available.
peterwilsoncc Apr 20, 2026
b8da67f
Tests for caching related awareness storage.
peterwilsoncc Apr 20, 2026
ec1fa68
CS: alignment.
peterwilsoncc Apr 20, 2026
2023bfd
Simplify use of in memory cache.
peterwilsoncc Apr 20, 2026
3bbb01f
Let the cache determine how to cache arrays.
peterwilsoncc Apr 20, 2026
cd84de0
Test awareness setter does not destroy.
peterwilsoncc Apr 20, 2026
5b64704
Ensure awareness removes out of date clients from cache.
peterwilsoncc Apr 20, 2026
ca59c75
Ensure time is well formed.
peterwilsoncc Apr 20, 2026
b9d67ac
Method for generating cache key to avoid errors.
peterwilsoncc Apr 20, 2026
b26c3da
Tidy up comments.
peterwilsoncc Apr 20, 2026
c6eedae
Move storage class tests to own test suite.
peterwilsoncc Apr 21, 2026
e3dc7bb
Awareness tests.
peterwilsoncc Apr 21, 2026
7d5bb24
data integoryt tests.
peterwilsoncc Apr 21, 2026
b480459
Enable RTC for E2E tests.
peterwilsoncc Apr 21, 2026
9789172
Not in use. Not!
peterwilsoncc Apr 21, 2026
0d49cab
Test fixes, docs.
peterwilsoncc Apr 21, 2026
d66d532
Fix tests for new table.
peterwilsoncc Apr 21, 2026
7517f0c
Prevent duplicate entries.
peterwilsoncc Apr 21, 2026
75b1c85
Fix tests.
peterwilsoncc Apr 21, 2026
9e45662
Tests should include a date.
peterwilsoncc Apr 21, 2026
71242a2
Account for race conditions.
peterwilsoncc Apr 21, 2026
07ca965
Use true for site setting.
peterwilsoncc Apr 21, 2026
a529a51
Nope.
peterwilsoncc Apr 21, 2026
1f9e2ac
Fix E2E tests by including URL in current GB package.
peterwilsoncc Apr 21, 2026
af7c72f
Silly.
peterwilsoncc Apr 21, 2026
63c1315
Skip test that results in four collaborators on a single post.
peterwilsoncc Apr 21, 2026
c9db793
Compare state during updates.
peterwilsoncc Apr 21, 2026
8ef17f0
Try pressSequentially for password field.
peterwilsoncc Apr 22, 2026
0a3d31e
Try forcing it.
peterwilsoncc Apr 22, 2026
59d5f5a
How about this?
peterwilsoncc Apr 22, 2026
d869643
Wait for collaborator to leave before they rejoin.
peterwilsoncc Apr 22, 2026
a881cc3
Merge branch 'trunk' into collaboration/table-awareness-object-cache
peterwilsoncc Apr 22, 2026
7cf0fe8
Test is no longer skipped, remove comment explaining why it is skipped.
peterwilsoncc Apr 22, 2026
78f875a
Merge branch 'trunk' into collaboration/table-awareness-object-cache
peterwilsoncc Apr 22, 2026
e25b9c9
Merge branch 'trunk' into collaboration/table-awareness-object-cache
peterwilsoncc Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@
wp_schedule_event( time(), 'daily', 'delete_expired_transients' );
}

// Schedule collaboration data cleanup.
if ( wp_is_collaboration_enabled()
&& ! wp_next_scheduled( 'wp_delete_old_collaboration_data' )
&& ! wp_installing()
) {
wp_schedule_event( time(), 'daily', 'wp_delete_old_collaboration_data' );
}

set_screen_options();

$date_format = __( 'F j, Y' );
Expand Down
14 changes: 14 additions & 0 deletions src/wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
KEY post_parent (post_parent),
KEY post_author (post_author),
KEY type_status_author (post_type,post_status,post_author)
) $charset_collate;
CREATE TABLE $wpdb->collaboration (
id bigint(20) unsigned NOT NULL auto_increment,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

event_id, sync_id?? This needs to be some thing_id to match the majority of other WP tables.

room varchar($max_index_length) NOT NULL default '',
type varchar(32) NOT NULL default '',
client_id varchar(32) NOT NULL default '',
user_id bigint(20) unsigned NOT NULL default '0',
data longtext NOT NULL,
date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id),
KEY type_client_id (type,client_id),
KEY room (room,id),
KEY room_type_date (room,type,date_gmt),
KEY date_gmt (date_gmt)
) $charset_collate;\n";

// Single site users table. The multisite flavor of the users table is handled below.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ function upgrade_all() {
upgrade_682();
}

if ( $wp_current_db_version < 61644 ) {
if ( $wp_current_db_version < 61841 ) {
upgrade_700();
}

Expand Down
10 changes: 10 additions & 0 deletions src/wp-includes/class-wpdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class wpdb {
'term_relationships',
'termmeta',
'commentmeta',
'collaboration',
);

/**
Expand Down Expand Up @@ -404,6 +405,15 @@ class wpdb {
*/
public $posts;

/**
* WordPress Collaboration table.
*
* @since 7.0.0
*
* @var string
*/
public $collaboration;

/**
* WordPress Terms table.
*
Expand Down
46 changes: 43 additions & 3 deletions src/wp-includes/collaboration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*
* If the WP_ALLOW_COLLABORATION constant is false,
* collaboration is always disabled regardless of the database option.
* Otherwise, falls back to the 'wp_collaboration_enabled' option.
* Otherwise, the feature requires both the 'wp_collaboration_enabled'
* option and the database schema introduced in db_version 61841.
*
* @since 7.0.0
*
Expand All @@ -20,7 +21,8 @@
function wp_is_collaboration_enabled() {
return (
wp_is_collaboration_allowed() &&
(bool) get_option( 'wp_collaboration_enabled' )
get_option( 'wp_collaboration_enabled' ) &&
get_option( 'db_version' ) >= 61841
);
}

Expand All @@ -34,7 +36,7 @@ function wp_is_collaboration_enabled() {
*
* @since 7.0.0
*
* @return bool Whether real-time collaboration is enabled.
* @return bool Whether real-time collaboration is allowed.
*/
function wp_is_collaboration_allowed() {
if ( ! defined( 'WP_ALLOW_COLLABORATION' ) ) {
Expand Down Expand Up @@ -83,3 +85,41 @@ function wp_collaboration_inject_setting() {
'after'
);
}

/**
* Deletes stale collaboration data from the collaboration table.
*
* Removes non-awareness rows older than 7 days and awareness rows older
* than 60 seconds. Rows left behind by abandoned collaborative editing
* sessions are cleaned up to prevent unbounded table growth.
*
* @since 7.0.0
*/
function wp_delete_old_collaboration_data() {
global $wpdb;

if ( ! wp_is_collaboration_enabled() ) {
/*
* Collaboration was enabled in the past but has since been disabled.
* Unschedule the cron job prior to clean up so this callback does not
* continue to run.
*/
wp_clear_scheduled_hook( 'wp_delete_old_collaboration_data' );
}

/* Clean up rows older than 7 days. */
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->collaboration} WHERE date_gmt < %s",
gmdate( 'Y-m-d H:i:s', time() - WEEK_IN_SECONDS )
)
);

// Clean up awareness rows older than 60 seconds.
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->collaboration} WHERE type = 'awareness' AND date_gmt < %s",
gmdate( 'Y-m-d H:i:s', time() - 60 )
)
);
}
Loading
Loading