@@ -373,8 +373,10 @@ private function can_user_collaborate_on_entity_type( string $entity_kind, strin
373373 return current_user_can ( 'edit_comment ' , (int ) $ object_id );
374374 }
375375
376- // All the remaining checks are for collections. If an object ID is provided,
377- // reject the request.
376+ /*
377+ * All the remaining checks are for collections. If an object ID is
378+ * provided, reject the request.
379+ */
378380 if ( null !== $ object_id ) {
379381 return false ;
380382 }
@@ -389,9 +391,11 @@ private function can_user_collaborate_on_entity_type( string $entity_kind, strin
389391 return current_user_can ( $ post_type_object ->cap ->edit_posts );
390392 }
391393
392- // Collection collaboration does not exchange entity data. It only signals if
393- // another user has updated an entity in the collection. Therefore, we only
394- // compare against an allow list of collection types.
394+ /*
395+ * Collection collaboration does not exchange entity data. It only
396+ * signals if another user has updated an entity in the collection.
397+ * Therefore, we only compare against an allow list of collection types.
398+ */
395399 $ allowed_collection_entity_kinds = array (
396400 'postType ' ,
397401 'root ' ,
@@ -441,10 +445,12 @@ private function process_awareness_update( string $room, string $client_id, ?arr
441445 $ response [ $ entry ['client_id ' ] ] = $ entry ['state ' ];
442446 }
443447
444- // Other clients' states were decoded from the DB. Run the current
445- // client's state through the same encode/decode path so the response
446- // is consistent — wp_json_encode may normalize values (e.g. strip
447- // invalid UTF-8) that would otherwise differ on the next poll.
448+ /*
449+ * Other clients' states were decoded from the DB. Run the current
450+ * client's state through the same encode/decode path so the response
451+ * is consistent — wp_json_encode may normalize values (e.g. strip
452+ * invalid UTF-8) that would otherwise differ on the next poll.
453+ */
448454 if ( null !== $ awareness_update ) {
449455 $ response [ $ client_id ] = json_decode ( wp_json_encode ( $ awareness_update ), true );
450456 }
@@ -488,18 +494,20 @@ private function process_collaboration_update( string $room, string $client_id,
488494 }
489495
490496 if ( ! $ has_newer_compaction ) {
491- // Insert the compaction row before deleting old rows.
492- // Reversing the order closes a race window where a
493- // client joining with cursor=0 between the DELETE and
494- // INSERT would see an empty room for one poll cycle.
495- // The compaction row always has a higher ID than the
496- // deleted rows, so cursor-based filtering is unaffected.
497+ /*
498+ * Insert the compaction row before deleting old rows.
499+ * Reversing the order closes a race window where a
500+ * client joining with cursor=0 between the DELETE and
501+ * INSERT would see an empty room for one poll cycle.
502+ * The compaction row always has a higher ID than the
503+ * deleted rows, so cursor-based filtering is unaffected.
504+ */
497505 $ insert_result = $ this ->add_update ( $ room , $ client_id , $ type , $ data );
498506 if ( is_wp_error ( $ insert_result ) ) {
499507 return $ insert_result ;
500508 }
501509
502- if ( ! $ this ->storage ->remove_updates_before_cursor ( $ room , $ cursor ) ) {
510+ if ( ! $ this ->storage ->remove_updates_up_to_cursor ( $ room , $ cursor ) ) {
503511 global $ wpdb ;
504512 $ error_data = array ( 'status ' => 500 );
505513 if ( defined ( 'WP_DEBUG ' ) && WP_DEBUG ) {
@@ -515,8 +523,10 @@ private function process_collaboration_update( string $room, string $client_id,
515523 return true ;
516524 }
517525
518- // Reaching this point means there's a newer compaction, so we can
519- // silently ignore this one.
526+ /*
527+ * Reaching this point means there's a newer compaction,
528+ * so we can silently ignore this one.
529+ */
520530 return true ;
521531
522532 case self ::UPDATE_TYPE_SYNC_STEP1 :
0 commit comments