Skip to content

Commit 85b7491

Browse files
committed
Collaboration: Rename remove_updates_up_to_cursor to remove_updates_through_cursor
The previous name was ambiguous — it suggested exclusive semantics, but the query uses inclusive deletion (id <= %d). "through" clearly communicates the inclusive behavior without needing to read the docblock.
1 parent a5d543d commit 85b7491

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/collaboration/class-wp-collaboration-table-storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function get_updates_after_cursor( string $room, int $cursor ): array {
251251
* @param int $cursor Remove updates up to and including this cursor.
252252
* @return bool True on success, false on failure.
253253
*/
254-
public function remove_updates_up_to_cursor( string $room, int $cursor ): bool {
254+
public function remove_updates_through_cursor( string $room, int $cursor ): bool {
255255
global $wpdb;
256256

257257
// Uses a single atomic DELETE query, avoiding the race-prone

src/wp-includes/collaboration/class-wp-http-polling-collaboration-server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ private function process_collaboration_update( string $room, string $client_id,
507507
return $insert_result;
508508
}
509509

510-
if ( ! $this->storage->remove_updates_up_to_cursor( $room, $cursor ) ) {
510+
if ( ! $this->storage->remove_updates_through_cursor( $room, $cursor ) ) {
511511
global $wpdb;
512512
$error_data = array( 'status' => 500 );
513513
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ public function test_collaboration_awareness_rows_do_not_affect_cursor(): void {
18381838
}
18391839

18401840
/**
1841-
* Compaction (remove_updates_up_to_cursor) should not delete awareness rows.
1841+
* Compaction (remove_updates_through_cursor) should not delete awareness rows.
18421842
*
18431843
* @ticket 64696
18441844
*/

0 commit comments

Comments
 (0)