Page MenuHomePhabricator

When a deleted page is undeleted, the most recent edit should not be tagged with 'Recreated'
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Undelete a deleted page.

What happens?: The latest edit is tagged as "Recreated".

What should have happened instead?: No tag is applied to the latest edit.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
The "Recreated" tag has been added following T56145. The tag should only be added when recreating a deleted page, not when undeleting a deleted page. See https://en.wikipedia.org/w/index.php?title=Draft:Effects_of_different_voting_systems_under_similar_circumstances&action=history for an example of the "Recreated" tag having been applied to a CSD-tagging edit from 2019.

Event Timeline

A_smart_kitten subscribed.

Tagging Moderator-Tools-Team FYI as the team that implemented the feature; feel free to untag

Samwalton9-WMF renamed this task from Undeleting a deleted page tags the latest edit as "Recreated" to When a deleted page is undeleted, the most recent edit should not be tagged with 'Recreated'.Feb 3 2025, 11:49 AM
Samwalton9-WMF subscribed.

Good catch, I agree this is undesirable behaviour.

Change #1117255 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/core@master] When a deleted page is undeleted, the most recent edit should not be tagged with 'Recreated'

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

@Samwalton9-WMF
Would there be any other edge cases where a new page update would not be considered a recreate? I just want to make sure we're covering them all. Thanks!

Noting that I found another edge case but I can’t file a task about it right now - I’ll file it tomorrow though as soon as I get a chance

@Samwalton9-WMF
Would there be any other edge cases where a new page update would not be considered a recreate? I just want to make sure we're covering them all. Thanks!

Importing is the case I was about to test, but @A_smart_kitten got there before me :)

I wondered about moving pages over deleted pages, including over a redirect, but I tested it and this looks to be working correctly. I can't think of any other ways a page might be recreated in a way we don't expect.

History merging was another case I thought of, but I think that’s okay, as (iiuc) the destination page needs to already exist before Special:MergeHistory can be used to merge any history into it (https://github.com/wikimedia/mediawiki/blob/da6e91937610ae0bb323c518f05cc23b67fe4fc5/includes/specials/SpecialMergeHistory.php#L180-L185).

Good catch, I agree this is undesirable behaviour.

I'll elaborate, because I failed to do so earlier :)

When a page is created via a regular edit to a blank page, an edit exists in the revision history, which we add the tag to.

When a page is undeleted, no edit is made, only a log entry. As such there's no undeletion edit for us to add the tag to. The log entry is already inherently communicating that a previously deleted page has been recreated. I suppose we could be adding the Recreated tag to the log entry, but that's different to what we're doing right now, so I'm not sure if that's desirable.

The bug described here is that the Recreated tag is being added to the arbitrary most recent edit made to an undeleted page, which may not even show up in RecentChanges, because it may be from more than 30 days ago. As such I figured this patch, to simply not do the current thing was a first good step, and maybe later we can talk about whether we want to tag log entries.

@Samwalton9-WMF quick question -- if I've found more edge cases that could potentially result in undesired tagging, would it be better for me to create new tasks for them individually, or (e.g.) comment them here for you (and others) to take a look? (edit: if the former, would a parent task be helpful for tracking them?)

@Samwalton9-WMF quick question -- if I've found more edge cases that could potentially result in undesired tagging, would it be better for me to create new tasks for them individually, or (e.g.) comment them here for you (and others) to take a look? (edit: if the former, would a parent task be helpful for tracking them?)

I think individual tasks makes most sense, because the way we fix each of them will probably be different. I don't personally think a tracking task would be helpful right now, but I can create one if it gets to the point that it feels useful :)

jsn.sherman subscribed.

@Samwalton9-WMF thanks for the clarification! The patch is small and works as expected in local testing, so I +2ed it directly instead of waiting on a second review.

Change #1117255 merged by jenkins-bot:

[mediawiki/core@master] When a deleted page is undeleted, the most recent edit should not be tagged with 'Recreated'

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

we verified this is working as expected on testwiki; leaving open until deployment to all groups.