RTC: Backport fix to prevent autosaves from losing content.#11691
RTC: Backport fix to prevent autosaves from losing content.#11691dmsnell wants to merge 6 commits intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
dcb12a8 to
0db23e4
Compare
…sions to avoid post loss. Trac ticket: Core-65138 Follow-up to #75105 Part of #77716 See Core backport in WordPress/wordpress-develop#11691 When an RTC session in the editor saves edits on a draft post, they always save into an autosave revision. This prevents a sync but where storing to the post itself would lead to duplicate edits. This was set in 9df142b. However, there is an exception to this rule: the first session to save edits needs to promote the autosave revision into a real draft post, if a post doesn’t exist. The reason is that WordPress hides autosaves. That is, multiple people could be editing a draft post and then once they close it, never be able to find it again. While the data is still in the database, this is a loss of the post from a practical standpoint. This change introduces an exception where the first time a collaborative session is saving draft edits, the autodraft is promoted to a real draft post, making it visible in the post list. Developed in: #77865 Backport in: WordPress/wordpress-develop#11691 Trac ticket: https://core.trac.wordpress.org/ticket/65138 Co-authored-by: danluu <danluu@git.wordpress.org> Co-authored-by: dmsnell <dmsnell@git.wordpress.org>
…sions to avoid post loss. Trac ticket: Core-65138 Follow-up to #75105 Part of #77716 See Core backport in WordPress/wordpress-develop#11691 When an RTC session in the editor saves edits on a draft post, they always save into an autosave revision. This prevents a sync but where storing to the post itself would lead to duplicate edits. This was set in 9df142b839320316b406ee1a02e23704d42f8719. However, there is an exception to this rule: the first session to save edits needs to promote the autosave revision into a real draft post, if a post doesn’t exist. The reason is that WordPress hides autosaves. That is, multiple people could be editing a draft post and then once they close it, never be able to find it again. While the data is still in the database, this is a loss of the post from a practical standpoint. This change introduces an exception where the first time a collaborative session is saving draft edits, the autodraft is promoted to a real draft post, making it visible in the post list. Developed in: WordPress/gutenberg#77865 Backport in: WordPress/wordpress-develop#11691 Trac ticket: https://core.trac.wordpress.org/ticket/65138 Co-authored-by: danluu <danluu@git.wordpress.org> Co-authored-by: dmsnell <dmsnell@git.wordpress.org> Source: WordPress/gutenberg@6f328a8
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @danluu@git.wordpress.org. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Trac ticket: Core-65138
This is a companion change to WordPress/gutenberg#77865.
An interaction with autosave can cause posts and revisions to get lost even when a single user is editing a post.