Page MenuHomePhabricator

ContentTranslation's postMT hook is fired twice even though no MT is done
Closed, DeclinedPublic

Description

While investigating T104055 and translating "Róisín Murphy" from English to Hebrew, I noticed that the 'mw.cx.translation.postMT' hook is fired twice.

This may do the right thing functionally (and I'm not sure about this), but given that no MT is done at all and the target section is left completely empty (because of different direction), the code looks incorrect. If this is not really MT, it shouldn't be called "MT" - this only makes debugging harder.

Event Timeline

Amire80 created this task.Jun 27 2015, 2:00 PM
Amire80 raised the priority of this task from to Normal.
Amire80 updated the task description. (Show Details)
Amire80 added a project: ContentTranslation.
Amire80 added a subscriber: Amire80.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 27 2015, 2:00 PM

In case it's not clear, the problem is not just the name of the hook, but the fact that it fires twice. Among other things, it causes link adaptation to run twice. This wastes time and bandwidth and makes debugging unnecessarily harder.

Amire80 set Security to None.Jun 28 2015, 8:50 AM
Amire80 added a subscriber: santhosh.

Niklas's comment from a dupe bug: While investigating the parent report, I noticed we do lots of repeated API calls for link pairs. One of the reasons is that mw.cx.translation.postMT gets fired twice, first with origin as click and then immediately second time with origin as mt-user-disabled.

Amire80 moved this task from Needs Triage to CX6 on the ContentTranslation board.
Amire80 added a comment.EditedSep 2 2015, 4:19 AM

I ran into this again when I was debugging T110007, and it was in French, not Hebrew.

Amire80 renamed this task from when ContentTranslation translates from English to Hebrew, postMT hook is fired twice even though no MT is done to ContentTranslation's postMT hook is fired twice even though no MT is done.Sep 2 2015, 4:20 AM
Amire80 updated the task description. (Show Details)Sep 2 2015, 4:32 AM
Amire80 moved this task from CX6 to CX7 on the ContentTranslation board.Oct 2 2015, 2:51 PM
Arrbee raised the priority of this task from Normal to Needs Triage.Oct 29 2018, 1:31 PM
Arrbee moved this task from Bugs to Check & Move on the ContentTranslation board.Oct 29 2018, 1:34 PM

If the mw.cx.translation.postMT is only used in CX1, then it's OK to close this.

Nikerabbit closed this task as Declined.Nov 26 2018, 11:10 AM

I am fairly certain based on this code search that it is only used in CX1.