Xqt created this task. Xqt added a subscriber: Xqt. Xqt added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION Bug is reported on my talk page [1] The edit difference shows ignoring older edits [2] and saving without getting an edit confict:
``` New timestamp: 20150320115258 blocked user: 91.2.27.113 blocked by Graphikus, time: 20150320115257 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
blocked user: Huan Schmock blocked by Regi51, time: 20150320115059 length: unbeschränkt, reason: Kein Wille zur enzyklopädischen Mitarbeit erkennbar
blocked user: 91.19.70.54 blocked by Doc.Heintz, time: 20150320115005 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
blocked user: 84.143.218.173 blocked by Graphikus, time: 20150320114947 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
blocked user: 87.163.31.137 blocked by Logograph, time: 20150320114449 length: 3 Stunden, reason: geh bitte draußen spielen
blocked user: 93.220.155.168 blocked by Ukko, time: 20150320114411 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
blocked user: 91.4.144.201 blocked by Jivee Blau, time: 20150320113845 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
blocked user: 84.139.213.191 blocked by Jivee Blau, time: 20150320113807 length: 6 Stunden, reason: [[WP:Vd|Unsinnige Bearbeitungen]]
@@ -216,2 +216,3 @@ - == [[Benutzer:91.2.27.113]] == + == [[Benutzer:91.2.27.113]] (erl.) == - {{Benutzer|1=91.2.27.113}} Unsinnige Bearbeitungen: [[Special:Diff/14010 8986|1]] [[Special:Diff/140108923|2]] --[[Benutzer:Fish-guts|Fish-guts]] [[Benu tzer Diskussion:Fish-guts|Disk]] [[Benutzer:Fish-guts/Bewertung|+/-]] [[WP:MP| MP]] 12:52, 20. Mär. 2015 (CET) + {{Benutzer|1=91.2.27.113}} Unsinnige Bearbeitungen: [[Special:Diff/14010 8986|1]] [[Special:Diff/140108923|2]] --[[Benutzer:Fish-guts|Fish-guts]] [[Benu tzer Diskussion:Fish-guts|Disk]] [[Benutzer:Fish-guts/Bewertung|+/-]] [[WP:MP| MP]] 12:52, 20. Mär. 2015 (CET) + {{subst:Benutzer:Euku/Vorlage:VM-erl|Gemeldeter=91.2.27.113|Admin=Graphikus|Ze it=6 Stunden|Begründung=[[WP:Vd{{subst:!}}Unsinnige Bearbeitungen]]|subst=subst: }}
markiere: [[Spezial:Beiträge/91.2.27.113|91.2.27.113]] Page [[Wikipedia:Vandalismusmeldung]] saved defendant: Stauffen, accuser: Anidaat, time: 2015 Mär 20 12:16 waiting 16 seconds.
12:53:31:
```
page was read and it was saved after another user wrote to the page. Ther was no EditConflict exception or EditConflict Error which would cause the script restart reading the page and try again.
[1] https://de.wikipedia.org/wiki/Benutzer_Diskussion:Xqt#Fehler_im_Bot.3F [2] https://de.wikipedia.org/w/index.php?title=Wikipedia:Vandalismusmeldung&...
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt Cc: pywikipedia-bugs, Xqt, Aklapper, jayvdb
jayvdb added a subscriber: jayvdb. jayvdb added a comment.
Was this resolved? Or, have you seen it re-occur?
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: jayvdb, Xqt, Aklapper, pywikipedia-bugs
Mpaa added a subscriber: Mpaa. Mpaa added a comment.
A doubt. Before submitting the API request in site.py:
if lastrev is not None: params['basetimestamp'] = lastrev.timestamp
The timestamp has been updated to the value of the other edit, so no edit conflict appeared. Shouldn't basetimestamp be the timestamp of our current page instead the one of the latest revision?
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Mpaa Cc: Mpaa, jayvdb, Xqt, Aklapper, pywikipedia-bugs
Mpaa added a comment.
The problem here is that we should timestamp (using touched timestamp when retrieving it) the text that we are going to modify and use that timestamp as basestamp in editpage. The tricky part to me is to understand when the text that is going to be modified is loaded. First access? When page._text is first created? Updating timestamp every time page._text is updated is not reliable, as a call to page.latest_revision updates page._text as well, and this might happen also after the bot has modified the intended text.
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Mpaa Cc: Mpaa, jayvdb, Xqt, Aklapper, pywikipedia-bugs
Xqt added a comment.
I did this hack:
oldRawVMText = vmPage.text rev_id = vmPage.latest_revision_id
for reading and a sanity check before writing:
# sanity check if vmPage.latest_revision.revid != rev_id: print('Revision ID changed') raise pywikibot.EditConflict vmPage.put(newRawText, u"Bot: Abschnitt%s erledigt: %s" % (('', 'e')[bool(userOnVMpageFound-1)], editSummary + openSections + oldestHeadlineWithOpenStatus), False, minorEdit=True, force=True)
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt Cc: Mpaa, jayvdb, Xqt, Aklapper, pywikipedia-bugs
Mpaa added a comment.
With this change, I think this should not happen any more: https://gerrit.wikimedia.org/r/208574
@Xqt, if you keep your patch and you see a conflict also after pulling this change, please notify.
TASK DETAIL https://phabricator.wikimedia.org/T93364
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Mpaa Cc: Mpaa, jayvdb, Xqt, Aklapper, pywikipedia-bugs
XZise added a subscriber: XZise. XZise added a comment.
I've been working on a test case and it shows that there still seems to be a possibility for an `EditConflict` (or I misunderstood how it works): https://gerrit.wikimedia.org/r/215338
TASK DETAIL https://phabricator.wikimedia.org/T93364
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, Mpaa, jayvdb, Xqt, Aklapper, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org