daniel created this task.
daniel added projects: MediaWiki-Page-deletion, MediaWiki-Platform-Team, Wikidata, Multi-Content-Revisions.
Herald added a subscriber: Aklapper.

TASK DESCRIPTION

The documentation of Content::prepareSave() currently states:

This may be used to check the content's consistency with global state. This function should
NOT write any information to the database.
Note that this method will usually be called inside the same transaction
bracket that will be used to save the new revision.

This implies that prepareSave() may check that some aspect of the page content is globally unique, and can prevent the revision from being saved if this is not the case. Wikibase currently uses this to enforce uniqueness of sitelinks.

MediaWiki's behavior is currently inconsistent with respect to this: when undeleting, prepareSave() is called for the latest restorable row, preventing undeletion of pages if they would cause an inconsistency. However, no such check is performed by ImportableOldRevisionImporter when importing revisions.

Observation: strong guarantees about global consistency are not consistently enforced, and are hard to reconcile with undeletion and import, and seem incompatible with the wiki way of working.

Proposal: only call prepareSave() for explicit edits (via UI or API), but not for undeletion, import, or other programmatic creation of revisions. This still allows constraints to be enforced for user edits, while removing the risk of preventing undeletion due to conflicts. This technically doesn't weaken any guarantees, since prepareSave() was never calls during import. This adjustment firs well with the refactoring work for T174038: Implement MCR page update interface.

NOTE: This is arguably a breaking change for Wikibase, as it may cause conflicting sitelinks to surface in the current revision of a page through import or undeletion. This would cause a database error when running the respective DataUpdate. Wikibase would have to be changed to ignore this kind of failure, and instead show a warning on pages that have conflicting sitelinks, asking users to resolve the issue.

TASK DETAIL
https://phabricator.wikimedia.org/T192777

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: Aklapper, hoo, Anomie, Tgr, Lydia_Pintscher, daniel, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to