| Anomie added a comment. |
It looks like EditPage editRevId/getBaseRevision() and parentRevId/getParentRevId() should be equivalent until the edit is actually saved. They differ after EditPage successfully does merge3() during the save, at which point editRevId continues to represent the parent of the user's submission while parentRevId represents the parent of the content actually being saved.
It looks like EditPage's oldid and WikiPage's $baseRevId should be equivalent when oldid != 0. When oldid == 0, I believe $baseRevId should be editRevId. It more or less indicates the revision that was used to initialize the textarea.
The rev_parent_id saved should match EditPage's parentRevId. It looks like there's a possible race where edits A→B→C could have C's rev_parent_id as A even though merge3() used B's content.[1]
PageUpdater's baseRevId seems to be used as both parentRevId and oldid in different places. It's used like parentRevId to detect conflicts (and maybe in checkFlags() too), and like oldid in being passed to the 'NewRevisionFromEditComplete' and 'PageContentSaveComplete' hooks.
[1]: EditPage::internalAttemptSave() calls $this->page->getLatest(), which caches inside WikiPage. 🏎 Then mergeChangesIntoContent() loads the current revision via Revision::loadFromTitle() instead of getting it from WikiPage. Pre-PageUpdater, WikiPage::doEditContent() reuses that cached ->getLatest() value for rev_parent_id. Post-PageUpdater, DerivedPageDataUpdater::grabCurrentRevision() calls WikiPage::getRevision() which uses that cached ->getLatest(). If edit B gets saved at the 🏎, that's the race.
Cc: GoranSMilovanovic, gerritbot, Anomie, CCicalese_WMF, Aklapper, daniel, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, PDrouin-WMF, Gq86, Baloch007, E1presidente, Ramsey-WMF, Cparle, Darkminds3113, SandraF_WMF, Bsandipan, Lordiis, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Tramullas, Acer, LawExplorer, Lewizho99, JJMC89, Maathavan, Agabi10, Susannaanas, Aschroet, Fjalapeno, Jane023, Wikidata-bugs, PKM, Base, matthiasmullie, aude, Ricordisamoa, Lydia_Pintscher, Fabrice_Florin, Raymond, Steinsplitter, Mbch331, Ltrlg
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
