Skip to content

Commit 80ed666

Browse files
committed
Collaboration: Replace leftover sync terminology in comments
Replaces "sync update" and "sync data" with "collaboration" or "update" in comments and test assertion messages across source, tests, and benchmark scripts. Code and method names are unchanged.
1 parent 93adae4 commit 80ed666

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/wp-includes/collaboration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function wp_collaboration_inject_setting() {
4141
/**
4242
* Deletes stale collaboration data from the collaboration table.
4343
*
44-
* Removes sync-update rows older than 7 days and awareness rows older than
44+
* Removes collaboration rows older than 7 days and awareness rows older than
4545
* 60 seconds. Rows left behind by abandoned collaborative editing sessions
4646
* are cleaned up to prevent unbounded table growth.
4747
*
@@ -54,7 +54,7 @@ function wp_delete_old_collaboration_data() {
5454

5555
global $wpdb;
5656

57-
// Clean up sync update rows older than 7 days.
57+
// Clean up collaboration rows older than 7 days.
5858
$wpdb->query(
5959
$wpdb->prepare(
6060
"DELETE FROM {$wpdb->collaboration} WHERE created_at < %s",

tests/phpunit/tests/rest-api/rest-collaboration-server.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,13 +1345,13 @@ public function test_collaboration_awareness_rows_do_not_affect_cursor(): void {
13451345
)
13461346
);
13471347

1348-
// With no sync updates, cursor should be 0.
1348+
// With no updates, cursor should be 0.
13491349
$data1 = $response1->get_data();
13501350
$this->assertSame( 0, $data1['rooms'][0]['end_cursor'], 'Awareness rows should not affect the cursor.' );
13511351
$this->assertSame( 0, $data1['rooms'][0]['total_updates'], 'Awareness rows should not count as updates.' );
13521352
$this->assertEmpty( $data1['rooms'][0]['updates'], 'Awareness rows should not appear as updates.' );
13531353

1354-
// Now add a sync update.
1354+
// Now add an update.
13551355
$update = array(
13561356
'type' => 'update',
13571357
'data' => 'dGVzdA==',
@@ -1363,7 +1363,7 @@ public function test_collaboration_awareness_rows_do_not_affect_cursor(): void {
13631363
);
13641364

13651365
$data2 = $response2->get_data();
1366-
$this->assertSame( 1, $data2['rooms'][0]['total_updates'], 'Only sync updates should count toward total.' );
1366+
$this->assertSame( 1, $data2['rooms'][0]['total_updates'], 'Only updates should count toward total.' );
13671367
}
13681368

13691369
/**
@@ -1502,15 +1502,15 @@ public function test_cron_cleanup_deletes_expired_awareness_rows(): void {
15021502
array( '%s', '%d', '%d', '%s', '%s' )
15031503
);
15041504

1505-
// Insert a recent sync update row (should survive).
1505+
// Insert a recent collaboration row (should survive).
15061506
$this->insert_collaboration_row( HOUR_IN_SECONDS );
15071507

1508-
$this->assertSame( 1, $this->get_collaboration_row_count(), 'Collaboration table should have 1 sync update row.' );
1508+
$this->assertSame( 1, $this->get_collaboration_row_count(), 'Collaboration table should have 1 row.' );
15091509
$this->assertSame( 1, $this->get_awareness_row_count(), 'Awareness table should have 1 awareness row.' );
15101510

15111511
wp_delete_old_collaboration_data();
15121512

1513-
$this->assertSame( 1, $this->get_collaboration_row_count(), 'Only the recent sync update row should survive cron cleanup.' );
1513+
$this->assertSame( 1, $this->get_collaboration_row_count(), 'Only the recent collaboration row should survive cron cleanup.' );
15141514
$this->assertSame( 0, $this->get_awareness_row_count(), 'Expired awareness row should be deleted after cron cleanup.' );
15151515
}
15161516

tools/local-env/scripts/collaboration-perf/DO_NOT_RELEASE_prove-beta3-post_meta_data_loss.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Proves that post meta compaction loses sync data.
3+
* Proves that post meta compaction loses collaboration data.
44
*
55
* Compaction triggers at 50 updates, keeping the newest 20% (10) and
66
* discarding the oldest 80% (40).
@@ -32,7 +32,7 @@
3232
$keep = $total - $discard; // 20% — the newest updates that should remain.
3333

3434
// =====================================================================
35-
// Setup: 50 sync updates exist in both backends.
35+
// Setup: 50 updates exist in both backends.
3636
// =====================================================================
3737

3838
// Table backend.
@@ -99,7 +99,7 @@
9999
// }
100100
// }
101101
//
102-
// Between the delete and the first re-insert, the sync history is empty.
102+
// Between the delete and the first re-insert, the update history is empty.
103103
// =====================================================================
104104

105105
// Step 1 of 2: delete ALL updates (this is the production code path).

0 commit comments

Comments
 (0)