Steps to replicate the issue (include links if applicable):
- Create a page "Delete Me" with content "Step 1"
- Delete the page "Delete Me", keep the tab open or open the delete log
- Create another page with the same title "Delete Me" and content "Step 3"
- Go back to the delete log and undelete the latest revision
Related logs from testwiki select * from logging where log_title like "PFischer-WMF/Delete_Me":
log_id | log_type | log_action | log_timestamp | log_actor | log_namespace | log_title | log_comment_id | log_params | log_deleted | log_page |
---|---|---|---|---|---|---|---|---|---|---|
367396 | create | create | 20231116130659 | 122252.0 | 2 | PFischer-WMF/Delete_Me | 246686.0 | "a:1:{s:17:""associated_rev_id"";i:582959;}" | 0 | 153559 |
367398 | delete | delete | 20231116130740 | 122252.0 | 2 | PFischer-WMF/Delete_Me | 246687.0 | a:0:{} | 0 | 153559 |
367399 | create | create | 20231116131014 | 122252.0 | 2 | PFischer-WMF/Delete_Me | 246688.0 | "a:1:{s:17:""associated_rev_id"";i:582960;}" | 0 | 153560 |
367400 | delete | restore | 20231116131032 | 122252.0 | 2 | PFischer-WMF/Delete_Me | 246689.0 | "a:1:{s:12:"":assoc:count"";a:2:{s:9:""revisions"";i:1;s:5:""files"";i:0;}}" | 0 | 153560 |
What happens?:
- The UI implies a successful undelete
- The content of "Delete Me" is still "Step 3", not "Step 1" as the initial, undeleted revision
- An event is published (by the event bus extension) that implies an undelete has happened. ⚠ It carries the rev_id of the deleted revision but the page_id of the recreated page, see API request: https://test.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&revids=582959&formatversion=2
What should have happened instead?:
I would consider that case an exception. If the undelete does not have an effect, no event should be published. If undeleting and thereby overriding an existing page should be supported, I would a behaviour as follows:
- delete the current page (sharing the same title)
- restore the old page (under its original page_id!)
Software version (skip for WMF-hosted wikis like Wikipedia): https://test.wikipedia.org/
Other information (browser name/version, screenshots, etc.): This came to my attention while testing the search update pipeline. For revision based changed, we fetch the content of the changed page (via cirrussearch API extension) by rev_id and fail if the event's page_id does not match the one returned from the API.