Page MenuHomePhabricator

page.touch can recreate a deleted page
Closed, ResolvedPublic

Description

HAVE DOUGHNUT was deleted at 01:13, 3 May 2018 (UTC) while the below command was running. At 01:17 touch.py recreated the page with the content prior to deletion.

Command started 01:02 3 May 2018 via cron: python /shared/pywikipedia/core/scripts/touch.py -lang:en -family:wikipedia -cat:'Pages using duplicate arguments in template calls'

Pywikibot's page.touch should not be able to recreate pages

Event Timeline

JJMC89 created this task.May 4 2018, 4:35 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMay 4 2018, 4:35 AM
Dvorapa added a subscriber: Dvorapa.May 4 2018, 3:30 PM

Also when there are more blank lines at the end of the page (e.g. imported or from Wikipedia beginnings or so), the page is edited too. Maybe there should be some better check (API?) we didn't change anything by touch, just null edit?

Xqt added a subscriber: Xqt.May 4 2018, 4:07 PM

Maybe there should be some better check (API?) we didn't change anything by touch, just null edit?

That's the problem with null edits (not the -purge option): we read the page content and write them back. And if the content is changed in meanwhile we have that problem. This is a kind of edit conflict which isn't really solved I guess. I would expect getting a token when reading and submitting it with writing and if something has been changed between read and write operation there should be any exception from API. But there isn't any currently I guess.

Xqt triaged this task as High priority.May 4 2018, 4:08 PM

Change 472374 had a related patch set uploaded (by JJMC89; owner: JJMC89):
[pywikibot/core@master] [FIX] Prevent touch from creating pages

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

Xqt assigned this task to JJMC89.Nov 8 2018, 11:35 AM
Xqt closed this task as Resolved.Nov 9 2018, 9:21 AM

Thanks a lot JJMC89!

Change 472374 merged by jenkins-bot:
[pywikibot/core@master] [FIX] Prevent touch from re-creating pages

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