Last modified: 2012-12-13 11:17:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39685, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37685 - detect edit conflicts on entities
detect edit conflicts on entities
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
master
All All
: High critical (vote)
: ---
Assigned To: Wikidata bugs
storypoints: 13
:
Depends on: 39141
Blocks: 38975
  Show dependency treegraph
 
Reported: 2012-06-18 12:19 UTC by Daniel Kinzler
Modified: 2012-12-13 11:17 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2012-06-18 12:19:37 UTC
The item edit functionality has to implement detection of edit conflicts. Even with atomic edits and an Ajax based UI, edit conflicts can still happen and lead to inadvertedly overriding someone elses work:

1) A loads page X, with property foo=2 and bar=bla
2) B loads page X, with property foo=2 and bar=bla
3) A sets Foo from 2 to 3 and saves
4) B sets Foo from 2 to 4 and saves
5) B has unknowingly overwritten A's change.

Conflict resolution will be trivial with atomic edits, though: if A and B change different properties, they do not actually generate a conflict.
Comment 1 jeblad 2012-06-18 13:55:51 UTC
Keep revid for background page in user interface, but maintain also a list of last observed revid for other fields. On edit supply the last observed revid to the API which then supplies the revid to doEditContent. If the edit succeed the new revid is reported back to the requester. The requester then knows that the old revid can be replaced by the new revid, so it updates other revids including the one used for the background. If a new revid is not reported back there is an edit conflict. All non-changed fields can then be updated anew but the user interface must somehow show the conflict for the specific field if that is the one he is editing.

Somehow-ish...
Comment 2 Daniel Kinzler 2012-06-18 15:23:08 UTC
I think that's pretty much how EditPage does it. I suggest we try to make the behavior consistent with what happens for wikitext. Maybe ApiEditPage can help us to find out how it's done best. If ApiEditPage does in fact do conflict detection.
Comment 3 denny vrandecic 2012-06-21 15:22:29 UTC
Send the old value and check if it is still the old value. If it is not, report a conflict.

Think about set based values again, if this actually works.
Comment 4 denny vrandecic 2012-06-28 10:43:23 UTC
For now: simply detect such a collision and report it, telling the user to reload.

This contains an API part and a UI part.

Before closing this item set up a new one for making it nicer (e.g. maybe let the user change to override the change, abandon its change, reload this field?, reload all?, etc.)
Comment 5 jeblad 2012-07-03 10:15:12 UTC
It seems like collision detection works in some cases, but it then simply fails on save. I saw this behavior when doing upload by importInterlang.php, but could not duplicate the behavior when being logged in with two user accounts on the same repo.
Comment 6 Jeroen De Dauw 2012-07-23 12:19:25 UTC
Changed title to reflect this is not item specific. Most code will be on entity level, with maybe some specific handling per entity type (ie item, property, query).
Comment 7 denny vrandecic 2012-08-02 09:37:09 UTC
Disregard my comment #3. Send instead the base revision, take the value from there, compare it to the current value, and update if equal to the new value.
Comment 8 jeblad 2012-08-31 13:41:48 UTC
Final version for now is "detect such a collision and report it, telling the user to reload." That means no patching as of now.
Comment 9 Anja Jentzsch 2012-11-29 12:38:14 UTC
Verified in Wikidata demo time for sprint 14

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links