Page MenuHomePhabricator

Notify the deletion of very old unpublished translation drafts
Closed, ResolvedPublic

Description

Translations that were started a really long time ago are problematic and it is preferred to discard them automatically at some point (T183890). We want still to tell users what happened and encourage them to still translate the page they were once interested if that makes sense.

Proposed solution

For translations in draft mode for more than a year, not being published. A notification is sent to tell the user that the draft was deleted since it was based on content that is more than one year old. If there are several translations in such situation, the notifications will be grouped into a bundle.

For translations older than a year that have been already published, those can be deleted without further notification. The user was warned after three months (T89707), and it makes not much sense to encourage to translate the content now.

The notifications to use are described below:

  • Text copy: "Your translation for <page-name> was discarded because its content was outdated by more than a year. Start a new translation with fresh content anytime."
  • Main action (opening the notification): leads to translation dashboard with the new translation panel pre-filled ready to start the translation.
  • Secondary action: “Your translations” leads to the Translations dashboard showing the in-progress view.

Bundled version

  • Text copy: "<number-of-translations> translations were discarded because their content was outdated by more than a year. Start them with fresh content anytime."
  • Opening the main notification leads to the Translations dashboard showing the in-progress view.
  • Opening the individual notification leads to translation dashboard with the new translation panel pre-filled ready to start the translation.

Graphic assets
For the notification icon we'll use a grey version of the translation icon to represent the translation was outdated:

Event Timeline

Pginer-WMF triaged this task as Normal priority.Jan 5 2018, 12:02 PM
Pginer-WMF created this task.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJan 5 2018, 12:02 PM
Pginer-WMF updated the task description. (Show Details)Jan 5 2018, 12:31 PM
Pginer-WMF updated the task description. (Show Details)May 4 2018, 12:35 PM

Change 431053 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Notify users about unpublished draft deletion

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

@Pginer-WMF, you wrote:

Main action (opening the notification): leads to translation dashboard with the new translation panel pre-filled ready to start the translation.

In which version of Content Translation should translation started this way be opened? I used CX2 in first patch set.

@Pginer-WMF, you wrote:

Main action (opening the notification): leads to translation dashboard with the new translation panel pre-filled ready to start the translation.

In which version of Content Translation should translation started this way be opened? I used CX2 in first patch set.

The translation should be started with whichever is the default version of CX in that wiki. Currently that would be CX1. When CX2 is released as default, CX2 will be used. This should be the same as if the user manually started the translation through the "new translation" button.

Thanks, @Pginer-WMF!

Another question coming from @Nikerabbit on gerrit patch. About message "X translations were discarded because their content was outdated by more than a year. Start them with fresh content anytime.", he said:
Hard coding the period in the message is quite inflexible. Are we sure that we are not going to go below a year?

So, do we want to say "outdated by more than a year" always or something more flexible? Will we ever go below one year mark?

Another question coming from @Nikerabbit on gerrit patch. About message "X translations were discarded because their content was outdated by more than a year. Start them with fresh content anytime.", he said:
Hard coding the period in the message is quite inflexible. Are we sure that we are not going to go below a year?
So, do we want to say "outdated by more than a year" always or something more flexible? Will we ever go below one year mark?

I don't expect the need for much flexibility here. The period was not selected with precision in mind, but to make it easy to communicate (and seemed long enough to justify the removal).

If there is anything that can be done to make future changes less painful, we can consider it; but I'd not invest much time or sacrifice the clarity of the message for the current case since it seems unlikely to change to a shorter period.

Change 431053 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Notify users about unpublished draft deletion

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

I could not get cx-deleted-draft notification in betalabs, and there is no such notifications recorded betalabs db.

Production db has cx-deleted-draft event_type in echo_event on enwiki:

event_id: 140268289
          event_type: cx-deleted-draft
       event_variant: NULL
      event_agent_id: NULL
      event_agent_ip: NULL
event_page_namespace: NULL
    event_page_title: NULL
         event_extra: a:3:{s:9:"recipient";i:35821218;s:6:"source";s:2:"en";s:6:"target";s:2:"ca";}
       event_page_id: 9701081
       event_deleted: 0

Unless, @Petar.petkovic has any idea how to receive such notifications in betalabs (or in cx- environment), I'm moving the task to Done without verification.

Etonkovidova moved this task from QA to Done on the Language-2018-Apr-June board.Jul 3 2018, 10:02 PM

Unless, @Petar.petkovic has any idea how to receive such notifications in betalabs (or in cx- environment), I'm moving the task to Done without verification.

Well, how did you try?

You can run "purge-unpublished-drafts" script in dry-run mode, and see how many drafts can be purged for given number of days ("age-in-days" param). Fine tune the age param to purge desired subset of old drafts. Then, running the script for real (with --really option) should delete the drafts from database and notify the users that started that translation.

Restricted Application added a project: Growth-Team. · View Herald TranscriptJul 6 2018, 9:15 AM
Etonkovidova added a comment.EditedJul 10 2018, 10:14 PM

I tried to run the script in betalabs where I have access to the server and db. I have more than a hundred of test users there, so I was hoping to find some old translation draft. So, I can run the script and see if the notification comes and how it looks.

(1) Finding such a user:

[wikishared]> select * from cx_translators where translator_user_id in (select gu_id from centralauth.globaluser where gu_name like 'ET%');

+--------------------+---------------------------+
| translator_user_id | translator_translation_id |
+--------------------+---------------------------+
|              20369 |                     81581 |
+--------------------+---------------------------+

(2) Finding the name of a user and what draft title/timestamp the user has:

[wikishared]> select * from cx_translations  where translation_id = 81581\G
*************************** 1. row ***************************
                    translation_id: 81581
          translation_source_title: Rowdy Gaines
          translation_target_title: Rowdy Gaines
       translation_source_language: en
       translation_target_language: ru
            translation_source_url: //en.wikipedia.org/wiki/Rowdy Gaines
            translation_target_url: https://en.wikipedia.beta.wmflabs.org/wiki/Rowdy_Gaines
                translation_status: draft
       translation_start_timestamp: 20160816194825
translation_last_updated_timestamp: 20160816200214
              translation_progress: {"any":0.24763705103969755,"human":0.09735349716446125,"mt":0.1502835538752363,"mtSectionsCount":2}
            translation_started_by: 20369
        translation_last_update_by: 20369
    translation_source_revision_id: 734775681
    translation_target_revision_id: 344508
            translation_cx_version: 1
1 row in set (0.01 sec)

(3) Verified that the translation/draft is, indeed, locked - it was true.

(4) Trying to run the script with various day ranges and see if that draft will be picked up. However, the script always (at least, for the dry-run) stops at 2015-11-06T14:14:11+00:00 timestamp even for --age-in-days=1 And translation_id: 81581 translation_source_title: Rowdy Gaines will not be there

(5) Out of curiosity, I checked my draft will be present in cx_drafts - seems that only my draft is missing :(

[wikishared]> select translation_id from cx_translations where translation_status='draft' and translation_id not in (select draft_id from cx_drafts);
+----------------+
| translation_id |
+----------------+
|          81581 |
+----------------+
1 row in set (0.01 sec)

Thanks to @KartikMistry explanation - the script does not work for betalabs. When the script will be run in cx2-testing for my test user, the notification should come and be verified.

Arrbee moved this task from QA to Done on the Language-2018-July-September board.Jul 16 2018, 7:14 AM
Arrbee closed this task as Resolved.Jul 16 2018, 7:17 AM