Page MenuHomePhabricator

wbmergeitems api modules did not correctly merge Q7 and Q194
Closed, ResolvedPublic

Description

https://test.wikidata.org/w/index.php?title=Q7&action=history
https://test.wikidata.org/w/index.php?title=Q194&action=history

See https://www.wikidata.org/wiki/MediaWiki_talk:Gadget-Merge.js#New_merge_API

It seems the first of the two edits was made (removing the data from the first item). but the second edit (adding the data to the second item) never went through.


Version: master
Severity: major
Whiteboard: u=dev c=backend p=8

Details

Reference
bz55960

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:21 AM
bzimport set Reference to bz55960.
bzimport added a subscriber: Unknown Object (MLST).

Problem is that we don't undo our changes to the first item (merge from) if the second item (merge target) can't be saved. There's also a TODO about that in the code "//todo if the second result is not a success we should probably undo the first change".

Solving that in a clean manner is hard, I guess... but this is actually causing trouble in production.

Change 105666 had a related patch set uploaded by Addshore:
Undo any edits if a Merge Fails!

https://gerrit.wikimedia.org/r/105666

Change 105666 abandoned by Addshore:
Undo any edits if a Merge Fails!

Reason:
per comment

https://gerrit.wikimedia.org/r/105666

After further discussion with Hoo it turns out the failed merges are due to the database having bad data in it already, i.e. two items that have the same label and description.
Because of this we can not simply undo the edit as wikibase will not allow this edit to happen.
Instead we should check that both edits will be possible before merging, this might require some further refactoring of content handler classes

  • Bug 60390 has been marked as a duplicate of this bug. ***

Change 110380 had a related patch set uploaded by Addshore:
Check for Label/Description conflicts in ChangeOpsMerge

https://gerrit.wikimedia.org/r/110380

Change 110380 merged by jenkins-bot:
Check for conflicts in ChangeOpsMerge preSave

https://gerrit.wikimedia.org/r/110380