diff --git a/backport-changelog/7.0/11716.md b/backport-changelog/7.0/11716.md new file mode 100644 index 00000000000000..2d5be7c7f232e6 --- /dev/null +++ b/backport-changelog/7.0/11716.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/11716 + +* https://github.com/WordPress/gutenberg/pull/77980 diff --git a/lib/compat/wordpress-7.0/class-wp-http-polling-sync-server.php b/lib/compat/wordpress-7.0/class-wp-http-polling-sync-server.php index ac3680ebb32f24..2d1a530ca7d085 100644 --- a/lib/compat/wordpress-7.0/class-wp-http-polling-sync-server.php +++ b/lib/compat/wordpress-7.0/class-wp-http-polling-sync-server.php @@ -500,9 +500,14 @@ private function process_sync_update( string $room, int $client_id, int $cursor, return $this->add_update( $room, $client_id, $type, $data ); } - // Reaching this point means there's a newer compaction, so we can - // silently ignore this one. - return true; + /* + * A newer compaction already advanced the cursor, but we + * can not safely drop an update. The incoming bytes still encode + * operations other clients may not have seen, so store them as a + * regular update. Y.applyUpdateV2 merges state-as-update blobs + * idempotently, so overlap with the existing compaction is safe. + */ + return $this->add_update( $room, $client_id, self::UPDATE_TYPE_UPDATE, $data ); case self::UPDATE_TYPE_SYNC_STEP1: case self::UPDATE_TYPE_SYNC_STEP2: