Edit conflict not detected, intermediate revision ignored
Open, Needs TriagePublic

Description

Hi, it seems that edit conflict are not always detected, with the intermediate revision ignored.

For example, see the history of article Éreutophobie on frwiki, with 2 modifications at 08:38 UTC on October 31st:

  • First diff made by Bloubéry
  • Second diff made manually by me with my tool WPCleaner under my bot account.

But the edit I did was this one, as confirmed by :

  • The automatic edit comment (which talks about moving categories after the last section)
  • The logs I have, which confirm that I set the basetimestamp to 08:34:07, 4 minutes before Bloubéry edit
POST https://fr.wikipedia.org/w/api.php?tags=WPCleaner&summary=v1.37 - [[P:CS|Correction syntaxique]] (Catégorie avant la dernière section) - Suppression DEFAULTSORT inutile&watchlist=nochange&title=Éreutophobie&text=L''''éreutophobie''' est un [[trouble anxieux]] caractérisé par une crainte obsédante de [[rougissement|rougir]] en public. Ce trouble fait partie des [[phobies sociales]]....&basetimestamp=2015-10-31T08:34:07Z&token=160569d8c90ff408839f1bb4c228ac48563487ff+\&minor=&bot=&action=edit&assert=user&format=xml

Isn't the "basetimestamp" attribute supposed to prevent overwriting an intermediate version ?

NicoV created this task.Oct 31 2015, 10:25 AM
NicoV updated the task description. (Show Details)
NicoV raised the priority of this task from to Needs Triage.
NicoV added a subscriber: NicoV.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 31 2015, 10:25 AM
NicoV updated the task description. (Show Details)Oct 31 2015, 10:31 AM
NicoV set Security to None.
Ltrlg added a subscriber: Ltrlg.Oct 31 2015, 11:07 AM

Just to be sure: I did a similar test on a test page with a test text, and everything worked as expected : edit conflict detected and I couldn't save my modification.

Then, I tried the same test with the same text as the problem I reported : no edit conflict detected, and intermediate version ignored :

Anomie added a subscriber: Anomie.Nov 2 2015, 3:01 PM

I'm not seeing the problem here. It looks like it correctly automatically merged your bot edit with the intervening edit.

aaron added a comment.Nov 2 2015, 6:16 PM

If it was an auto-merge, shouldn't the "Liens externes" section not have been added back? Correctly auto-merging the intermediate link removal change should have resulted in the bot edit just being the category/defaultsort change.

Is it possible the bot did get an edit conflict but re-submitted the same text back, causing the link to come back?

Have you tested the same thing except using the wikitext editor in a browser for all steps instead of wpcleaner?

NicoV added a comment.Nov 2 2015, 6:45 PM

I can confirm that the didn't get an edit conflict, so didn't try to submit the same text again.

The first editor was surprised to see the text he deleted being added again, and I fully understand his surprise, as I got the same feeling.

For me, it's an edge case of the conflict resolution algorithm. I hope it can be tweaked to prevent this.
The problem is probably that it didn't see that a section deleted in the first edit was kept in the second edit (for me, I wasn't moving the section, but the portal and categories)

Anomie added a comment.EditedNov 2 2015, 8:14 PM

If it was an auto-merge, shouldn't the "Liens externes" section not have been added back? Correctly auto-merging the intermediate link removal change should have resulted in the bot edit just being the category/defaultsort change.

The bot edit was apparently also moving the "Liens externes" text above the categories (or, equivalently, moving the categories to after the "Liens externes" text, but the diff-merge algorithm seems to have picked it up as the former) and deleting the blank line between the header and the single line of content. The "remove" part of the move was identical to the intervening edit and so merged fine, while the "add it elsewhere" part was to a different part of the article and so didn't prevent a merge either.

It would be difficult for the merge algorithm to know the intention of the intervening edit was to remove the text completely and to know the bot edit would be seen as adding it back, slightly differently and in a different place.

aaron added a comment.Nov 2 2015, 9:16 PM

Right, that makes sense.

One could play around with the algorithms and how much they tend to count similar text moved around as possibly the same or totally new, though that's complex and has it's own tradeoffs in terms of thinking edits conflict that don't.

Nnemo awarded a token.Nov 3 2015, 2:01 AM
Nnemo added a subscriber: Nnemo.
Krinkle moved this task from Backlog to API on the MediaWiki-Page-editing board.Thu, Apr 12, 4:11 PM