Page MenuHomePhabricator

Migrate the draft translation restore mechanism to use data from cx_corpora table
Closed, ResolvedPublic

Description

As we started saving the secion-level data in cxc_corpora table, The document level data saved in cx_drafts table is redundant. But our translation draft restore mechanism relies on that table. We need a way to switch draft restore mechanism to corpora table . This should not affect any existing functionality at all too. I have the following rough idea:

  • ApiQueryContentTranslation should check if there is a saved data for the given translation id in cxc_corpora table. If so access the data from there , aggregate the sections in their linear order and return it.
    • If the data is not present in corpora table, check that in drafts table and fetch it.
    • Whenever we save the data to corpora table, remove the entry from drafts table asynchronously(not blocking the request).
  • Once the above steps are done stop saving the entire translation as part of autosave.
  • Still there will be entries left in drafts table since there are translations kind of abandoned or not used recently. We will have to do some notification to translators and remove them after a defined time. (this can be a separate ticket, outside the scope of this ticket).

In effect, the autosave mechanism should become granular.

Event Timeline

santhosh renamed this task from Migrate the draft translation restore mechanism from cx_corpora table to Migrate the draft translation restore mechanism to use data from cx_corpora table.
santhosh claimed this task.
santhosh raised the priority of this task from to High.
santhosh updated the task description. (Show Details)
santhosh set Security to None.
santhosh updated the task description. (Show Details)
santhosh added subscribers: jmadler, Pginer-WMF, Equ and 12 others.

Change 268645 had a related patch set uploaded (by Santhosh):
ApiQueryContentTranslation: Restore the saved translation from cxc_corpora table

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

Change 268645 merged by jenkins-bot:
Restore the saved translation from cxc_corpora table

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