Make WordPress Core

Opened 7 weeks ago

Last modified 3 weeks ago

#65138 new task (blessed)

RTC: Real-time collaboration bug sprint for 7.1

Reported by: dmsnell's profile dmsnell Owned by:
Milestone: 7.1 Priority: normal
Severity: normal Version: 7.0
Component: Posts, Post Types Keywords: has-patch has-unit-tests gutenberg-merge
Focuses: tests Cc:

Description

As part of a project to uncover latent bugs using an AI-assisted fuzzer, this ticket is tracking work to find and address bugs in the version of real-time collaborative editing in WordPress 7.0.

Work in this ticket should be addressing existing bugs and propose only fixes to those bugs for the 7.0 release.

Change History (16)

This ticket was mentioned in PR #11660 on WordPress/wordpress-develop by @dmsnell.


7 weeks ago
#1

  • Keywords has-patch has-unit-tests added

Trac ticket: Core-65138

Backport of https://github.com/WordPress/gutenberg/pull/77675

A race condition on opening an editor session allows for Core to create duplicate post meta for sync storage. This creates two copies of the document which the editors operate on independently, leading to a mismatch between the sessions.

In this patch, when such a duplicate storage row is detected, a canonical version of the post meta is chosen (the one with the lowest id viz. the oldest one) and the duplicate is merged into it.

This should ensure that all edit sessions for a given post use the same synchronized backing store.

Trac ticket:

## Use of AI Tools

#2 @wildworks
7 weeks ago

  • Keywords gutenberg-merge added

@dmsnell commented on PR #11660:


7 weeks ago
#3

thanks @apermo — for now this is still a draft and mainly here to backport an upstream change in Gutenberg. I didn’t want to change the patch yet; just preserve what’s on the other side so tests can run and all.

I think you have good feedback; the original code was created by LLMs and that’s why it seems confused and split-brained.

#4 @desrosj
6 weeks ago

@dmsnell Will this race condition still be relevant if the architecture moves towards tables/transients instead?

This ticket was mentioned in PR #11691 on WordPress/wordpress-develop by @dmsnell.


6 weeks ago
#5

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.

#6 @dmsnell
6 weeks ago

In 62311:

RTC: Promote auto-draft posts on first autosave for collaborative sessions to avoid post loss.

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 wordpress/gutenberg commit 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.

AI Disclaimer: This bug was detected in a fuzzing system built by AI models and the fix was first proposed by an AI model.

Developed in: https://github.com/WordPress/gutenberg/pull/77865
Discussed in: https://core.trac.wordpress.org/ticket/65138
See also: https://github.com/WordPress/gutenberg/pull/77716

Follow-up to [61680].
Props danluu, dmsnell.
See #65138.

#7 @dmsnell
6 weeks ago

  • Keywords dev-feedback added

Adding dev-feedback for backport of [62311] into 7.0. It is merged into Gutenberg and merged into trunk.

#8 @dmsnell
6 weeks ago

@desrosj we have a few hundred identified bugs and are grouping them in this ticket. at least most of them would remain after a change to transients or a table.

This ticket was mentioned in Slack in #core by jorbin. View the logs.


6 weeks ago

#10 @jorbin
6 weeks ago

  • Keywords fixed-major dev-reviewed added; dev-feedback removed

[62311] looks good for backport to 7.0

@dmsnell It may make sense to open separate tickets for each issue, otherwise the keywords are going to get tricky and it may be easy to miss some backports.

#11 @dmsnell
6 weeks ago

thanks @jorbin — would there be another way I could create or prep a backport rather than creating a bunch of Trac tickets? I can see where some things would be very much clearer with a separate one, but already we’re talking about two PRs and a Trac ticket for each of these bugs, and they are all basically just things that appear in testing the collaborative editing.

I’ll try and keep up with all the accounting; but if we can figure out a way that meets everyone’s needs without it, that would give that time back to finding and fixing the bugs before the release.

#13 @jorbin
5 weeks ago

  • Keywords fixed-major dev-reviewed removed

In light of the decision to not ship RTC, I am withdrawing my review for backporting and noting that this needs to be reverted.

#14 @ellatrix
5 weeks ago

  • Milestone changed from 7.0 to 7.1

Punting to 7.1, see #65205.

#15 @audrasjb
4 weeks ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

#16 @johnbillion
3 weeks ago

  • Summary changed from RTC: Real-time collaboration bug sprint for 7.0 to RTC: Real-time collaboration bug sprint for 7.1
  • Type changed from defect (bug) to task (blessed)
Note: See TracTickets for help on using tickets.