You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/wp-includes/collaboration/class-wp-collaboration-table-storage.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ public function get_awareness_state( string $room, int $timeout = 30 ): array {
145
145
146
146
$rows = $wpdb->get_results(
147
147
$wpdb->prepare(
148
-
"SELECT client_id, user_id, date_gmt, data FROM {$wpdb->collaboration} WHERE room = %s AND type = 'awareness' AND date_gmt >= %s ORDER BY id ASC",
148
+
"SELECT client_id, user_id, date_gmt, data FROM {$wpdb->collaboration} WHERE room = %s AND type = 'awareness' AND date_gmt >= %s ORDER BY collaboration_id ASC",
149
149
$room,
150
150
$cutoff_mysql
151
151
)
@@ -231,7 +231,7 @@ public function get_updates_after_cursor( string $room, int $cursor ): array {
231
231
/* Snapshot the current max ID and total row count in a single query. */
232
232
$snapshot = $wpdb->get_row(
233
233
$wpdb->prepare(
234
-
"SELECT COALESCE( MAX( id ), 0 ) AS max_id, COUNT(*) AS total FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness'",
234
+
"SELECT COALESCE( MAX( collaboration_id ), 0 ) AS max_id, COUNT(*) AS total FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness'",
235
235
$room
236
236
)
237
237
);
@@ -262,7 +262,7 @@ public function get_updates_after_cursor( string $room, int $cursor ): array {
262
262
/* Fetch updates after the cursor up to the snapshot boundary. */
263
263
$rows = $wpdb->get_results(
264
264
$wpdb->prepare(
265
-
"SELECT data FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND id > %d AND id <= %d ORDER BY id ASC",
265
+
"SELECT data FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND collaboration_id > %d AND collaboration_id <= %d ORDER BY collaboration_id ASC",
266
266
$room,
267
267
$cursor,
268
268
$max_id
@@ -302,7 +302,7 @@ public function remove_updates_through_cursor( string $room, int $cursor ): bool
302
302
// "delete all, re-add some" pattern.
303
303
$result = $wpdb->query(
304
304
$wpdb->prepare(
305
-
"DELETE FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND id <= %d",
305
+
"DELETE FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND collaboration_id <= %d",
306
306
$room,
307
307
$cursor
308
308
)
@@ -413,7 +413,7 @@ public function set_awareness_state( string $room, string $client_id, array $sta
413
413
*/
414
414
$exists = $wpdb->get_row(
415
415
$wpdb->prepare(
416
-
"SELECT id, date_gmt, data FROM {$wpdb->collaboration} WHERE room = %s AND type = 'awareness' AND client_id = %s ORDER BY id DESC LIMIT 1",
416
+
"SELECT collaboration_id, date_gmt, data FROM {$wpdb->collaboration} WHERE room = %s AND type = 'awareness' AND client_id = %s ORDER BY collaboration_id DESC LIMIT 1",
417
417
$room,
418
418
$client_id
419
419
)
@@ -432,7 +432,7 @@ public function set_awareness_state( string $room, string $client_id, array $sta
0 commit comments