Page MenuHomePhabricator

Disable edit summary mention notifications when a revert of a translation is copied to a translated version of the page
Open, Needs TriagePublic

Description

This might be related to T189819. I receive notifications on foundationwiki if someone reverts edits back to a revision that has been edited by me. Examples: https://foundation.wikimedia.org/w/index.php?title=Policy%3APrivacy_policy%2Fvi&oldid=prev&diff=425920 https://foundation.wikimedia.org/w/index.php?title=Home%2Fvi&oldid=prev&diff=426593

These notifications are useless and I do not want to receive them. I guess this behavior is defined through MediaWiki:Revertpage

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

What kind of notification is it? "your edit has been reverted" or "mention in summary"?

Then, the workaround is to either remove the link or change it to [[:User:$1|$1]] (note the colon).

Mentions in edit summary are not sent for reverts. Notice, though, that the edits look like rollbacks, but they are actually not.

This might result from the actual revert on the translation subpage that is reflected on the translated page.

matmarex renamed this task from Disable notification for revert to last revision by user to Disable edit summary mention notifications when a revert of a translation is copied to a translated version of the page.Jun 19 2025, 1:31 AM

Thanks @matmarex for adding MediaWiki-extensions-Translate! Is there a way to copy the revert state from the translation unit page edit to the translation page edit? I’m slightly annoyed by my reverts being tagged as “manual reverts” on translation pages; while I can live with that, if we can kill two birds with one stone, and both fix the tag and remove the unnecessary notification, that’d be great. (The code is at rETRA src/TranslatorInterface/TranslateEditAddons.php:93 (at ab3f80ee8dbe), in particular the PageTranslationHooks::onSectionSave() call at the end of the function.)

This may be fixed now, needs testing:

By the way, I noticed that we also changed $isRevert = $editResult->getRevertMethod() === EditResult::REVERT_UNDO || $editResult->getRevertMethod() === EditResult::REVERT_ROLLBACK; to $isRevert = $event->isRevert();, which is not exactly the same either. As a result, manual reverts (i.e. viewing an older version of the page, then clicking edit and save; not using the undo or rollback buttons) will now be treated as reverts by this code.

This doesn't affect the revert notifications themselves, since they are sent elsewhere, but it will affect some other notification types that check whether an edit is a revert before sending notifications: at a glance, this will affect the summary mention notifications too (they are not sent for reverts), possibly fixing T373750 but making T340883 a bit worse; and page linked notifications (also not sent for reverts), apparently fixing T148949.

The change itself is probably okay (I think the way it worked was just a historical accident, and not intentional), but someone should check that these tasks are actually affected (I just read the code, haven't tested), maybe write unit tests for them.

Thanks @matmarex for adding MediaWiki-extensions-Translate! Is there a way to copy the revert state from the translation unit page edit to the translation page edit? I’m slightly annoyed by my reverts being tagged as “manual reverts” on translation pages; while I can live with that, if we can kill two birds with one stone, and both fix the tag and remove the unnecessary notification, that’d be great. (The code is at rETRA src/TranslatorInterface/TranslateEditAddons.php:93 (at ab3f80ee8dbe), in particular the PageTranslationHooks::onSectionSave() call at the end of the function.)

You can access the info from the EditResult object passed to the onSaveComplete() handler, pass it through PageTranslationHooks::onSectionSave() to RenderTranslationPageJob somehow, and then set the same info on the $pageUpdater object there (PageUpdater class). The names of the getters/setters don't exactly match, but the data should be the same… You can also look here for more examples: https://codesearch.wmcloud.org/search/?q=markAsRevert\(

(While the bug with notifications may be fixed, you'd still need to do the above to get the edit tags to be the same.,)