- Timestamp:
- 02/19/2026 10:25:06 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
r61429 r61689 233 233 $is_draft = 'draft' === $post->post_status || 'auto-draft' === $post->post_status; 234 234 235 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock ) { 235 /* 236 * In the context of real-time collaboration, all peers are effectively 237 * authors and we don't want to vary behavior based on whether they are the 238 * original author. Always target an autosave revision. 239 * 240 * This avoids the following issue when real-time collaboration is enabled: 241 * 242 * - Autosaves from the original author (if they have the post lock) will 243 * target the saved post. 244 * 245 * - Autosaves from other users are applied to a post revision. 246 * 247 * - If any user reloads a post, they load changes from the author's autosave. 248 * 249 * - The saved post has now diverged from the persisted CRDT document. The 250 * content (and/or title or excerpt) are now "ahead" of the persisted CRDT 251 * document. 252 * 253 * - When the persisted CRDT document is loaded, a diff is computed against 254 * the saved post. This diff is then applied to the in-memory CRDT 255 * document, which can lead to duplicate inserts or deletions. 256 */ 257 $is_collaboration_enabled = get_option( 'enable_real_time_collaboration' ); 258 259 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock && ! $is_collaboration_enabled ) { 236 260 /* 237 261 * Draft posts for the same author: autosaving updates the post and does not create a revision.
Note: See TracChangeset
for help on using the changeset viewer.