Page MenuHomePhabricator

Special:Nuke doesn't update the translate page for all deleted units
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

Looking at the history of that page, only one of the 3 created units that were deleted by Special:Nuke actually updated the page. And it wasn't the first nor the last for that page.

The other vandalized units are still visible on the translated page, but I can't purge them. Since there's no unit (they are deleted), I can't do a null-edit on them to refresh the translated page.

This is something that happens more or less frequently. It may not be related to Special:Nuke at all, since sometimes, when reverting edits in quick succession, this can happen too. The title may be updated to reflect a more broader issue.

Event Timeline

Also, they don't have "Reverted" or "Manual revert" tags where they should have respectively.

As I recalled, this happens also when doing reverts in quick succession.

Example, when I reverted 2 translation units of the same page. One succeeded but the other didn't:

my revert on the translation unit, but it wasn't propagated to the translated page

abi_ set the point value for this task to 4.Jul 5 2022, 5:09 AM

Change 815999 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] DNM: Add logs to debug outdated translation pages on mass deletion

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

I'm able to reproduce this locally. Here's what I think is happening:

  1. Nuke extension creates a DeletePageJob for each translation unit that is to be deleted.
  2. When the first DeletePageJob is executed, the ArticleDeleteComplete hook is triggered, and we use it to create a TranslateRenderJob, that is added to the job queue.
  3. In the same job queue run, other units get deleted and the ArticleDeleteComplete hook is triggered, but no TranslateRenderJobs are created for them due to the de-duplication logic we have in PageTranslationHooks::onDeleteTranslationUnit, and because we have removeDuplicates flag set on the TranslateRenderJob.
  4. The first render job that is created completes before the last DeletePageJob is run.

To prove this hypothesis, I added logs as per this patch and here's what I see:

2022-07-21 14:33:01 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/9/hi                  <-- Comment: First unit deleted
2022-07-21 14:33:01 wikimedia dev_wiki: Adding job TranslateRenderJob for Translations:Main Page Translate/9/hi 
2022-07-21 14:33:01 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/12/hi
2022-07-21 14:33:01 wikimedia dev_wiki: TranslateRenderJob [Main Page Translate/hi]: Starting TranslateRenderJob triggered by Translations:Main Page Translate/9/hi
2022-07-21 14:33:01 wikimedia dev_wiki: TranslateRenderJob [Main Page Translate/hi]: Finished page edit operation
2022-07-21 14:33:01 wikimedia dev_wiki: TranslateRenderJob [Main Page Translate/hi]: Finished TranslateRenderJob     <-- Comment: TranslateRenderJob already run!
2022-07-21 14:33:01 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/10/hi
2022-07-21 14:33:02 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/6/hi
2022-07-21 14:33:02 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/7/hi
2022-07-21 14:33:02 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/8/hi
2022-07-21 14:33:02 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/11/hi
2022-07-21 14:33:02 wikimedia dev_wiki: Unit deleted: Translations:Main Page Translate/13/hi        <-- Comment: Deletion for rest of the unit completes here.

This results in the translation page having the old translations for the units that were deleted after it ran.

Change 816229 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Add robust de-duplication to avoid outdated translation pages

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

Change 818439 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Add robust de-duplication to avoid outdated translation pages

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

Change 818439 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Remove custom job de-duplication logic on translation unit deletion

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

For this task we believe we've fixed the out of date translation pages when translation units are deleted using Special:Nuke extension. We've created a separate bug report to track the issue related to successive reverts: T314390: Successive translation unit reverts cause out of date translation pages

Our fix should go out with the train next week.

Change 815999 abandoned by Abijeet Patro:

[mediawiki/extensions/Translate@master] DNM: Add logs to debug outdated translation pages on mass deletion

Reason:

Replaced by: I97d9de4773719dcd53106871d0f35ad1165fbdac

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

Change 816229 abandoned by Abijeet Patro:

[mediawiki/extensions/Translate@master] [DNM] Add robust de-duplication to avoid outdated translation pages

Reason:

Replaced by: I97d9de4773719dcd53106871d0f35ad1165fbdac

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

I've done some testing with this on Translatewiki.net and did not notice any issues caused by this patch. Our local testing has revealed that our fixes should address the issue.

Please reopen this task if you continue to notice issues with outdated translation pages, when nuking translation unit pages.

Restricted Application added a subscriber: alaa. · View Herald TranscriptApr 2 2025, 7:24 PM