HomePhabricator

WIP: Use ArticleRevisionUndeleted instead of ArticleUndelete

Authored by Mattflaschen-WMF on May 17 2016, 4:32 PM.

Description

WIP: Use ArticleRevisionUndeleted instead of ArticleUndelete

ArticleUndelete was broken (meaning it causes inconsistent state) in
the following scenarios (but possibly also others)

1a. Create as Flow
1b. Delete Flow
1c. Create as wikitext
1d. Delete wikitext
1e. Create as wikitext
1f. Undelete both together

2a. Create page as wikitext.
2b. Delete wikitext
2c. Use Special:EnableFlow to create as Flow
2d. Delete Flow
2e. Restore just the wikitext
2f. Restore Flow using revision checkbox

title's content model both before and after the undeletion is wikitext).
Thus, the workflows are not updated, leading to inconsistent state.
AFAICT, a similar theme to #1 (Flow board restored when a wikitext page
was already top-level revision (and would remain after the restore))
caused the most recent production undeletion issue.

(it didn't recognize that the new top-level revision would be
Flow, so it didn't know to update the Flow workflows).

However, fixing that then causes it to reject the change,
since the current Title's ID (from the wikitext revision) is different
from the old page ID. It's actually Flow on top of wikitext,
but it wrongly detects it.

This needs more testing, but I think processing every revision
will avoid inconsistent states.

Bug: T122262
Change-Id: I552c119b47268a7888cf78d2fd1d5a9d98d51856