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
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ public function get_updates_after_cursor( string $room, int $cursor ): array {
192
192
/* Snapshot the current max ID and total row count in a single query. */
193
193
$snapshot = $wpdb->get_row(
194
194
$wpdb->prepare(
195
-
"SELECT COALESCE( MAX( id ), 0 ) AS max_id, COUNT(*) AS total FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness'",
195
+
"SELECT COALESCE( MAX( collaboration_id ), 0 ) AS max_id, COUNT(*) AS total FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness'",
196
196
$room
197
197
)
198
198
);
@@ -223,7 +223,7 @@ public function get_updates_after_cursor( string $room, int $cursor ): array {
223
223
/* Fetch updates after the cursor up to the snapshot boundary. */
224
224
$rows = $wpdb->get_results(
225
225
$wpdb->prepare(
226
-
"SELECT data FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND id > %d AND id <= %d ORDER BY id ASC",
226
+
"SELECT data FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND collaboration_id > %d AND collaboration_id <= %d ORDER BY collaboration_id ASC",
227
227
$room,
228
228
$cursor,
229
229
$max_id
@@ -263,7 +263,7 @@ public function remove_updates_through_cursor( string $room, int $cursor ): bool
263
263
// "delete all, re-add some" pattern.
264
264
$result = $wpdb->query(
265
265
$wpdb->prepare(
266
-
"DELETE FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND id <= %d",
266
+
"DELETE FROM {$wpdb->collaboration} WHERE room = %s AND type != 'awareness' AND collaboration_id <= %d",
267
267
$room,
268
268
$cursor
269
269
)
@@ -316,7 +316,7 @@ public function set_awareness_state( string $room, string $client_id, array $sta
316
316
/* Check if a row already exists. */
317
317
$exists = $wpdb->get_row(
318
318
$wpdb->prepare(
319
-
"SELECT id, date_gmtFROM {$wpdb->collaboration} WHERE room = %s AND type = 'awareness' AND client_id = %s LIMIT 1",
319
+
"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",
320
320
$room,
321
321
$client_id
322
322
)
@@ -335,7 +335,7 @@ public function set_awareness_state( string $room, string $client_id, array $sta
0 commit comments