(Go: >> BACK << -|- >> HOME <<)

Page MenuHomePhabricator

Error on tokenise method doesn't allow auto-saving or publishing of article
Closed, ResolvedPublic

Description

Actions:

  1. start translation
  2. translate math formulas
  3. if autosave works, go back to the dashboard and open the translation again
  4. translate another formula and see if autosave works

error:

VM34:formatted:30702 Uncaught TypeError: Cannot read property 'match' of undefined
    at Object.mw.cx.TranslationTracker.static.tokenise (<anonymous>:884:398)
    at MwCXTranslationTracker.<anonymous> (<anonymous>:893:434)
    at Array.forEach (<anonymous>)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.getUnmodifiedMTPercentageInTranslation (<anonymous>:893:307)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.getTranslationProgress (<anonymous>:893:1)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.init (<anonymous>:885:799)
    at MwCxTranslationController.mw.cx.TranslationController.onSurfaceReady (<anonymous>:881:195)
    at VeInitMwCXTarget.oo.EventEmitter.emit (<anonymous>:69:486)
    at VeInitMwCXTarget.ve.init.mw.Target.surfaceReady (<anonymous>:561:346)
    at VeInitMwCXTarget.ve.init.mw.CXTarget.surfaceReady (<anonymous>:355:645)

Method: mw.cx.TranslationTracker.static.tokenise
article: https://en.wikipedia.org/wiki/Proof_that_%CF%80_is_irrational
Translation: en to pt
https://pt.wikipedia.org/wiki/Special:ContentTranslation?page=Proof+that+%CF%80+is+irrational&from=en&to=pt&targettitle=User%3ADvpita%2FProof+that+%CF%80+is+irrational

image.png (395×728 px, 199 KB)

Event Timeline

Pginer-WMF triaged this task as Medium priority.Jul 9 2019, 8:02 AM

also happening when I translate this article https://en.wikipedia.org/wiki/Chronology_of_Gabon from en to es
Steps:

  1. open translation
  2. translate one paragraph from each of the sections
  3. wait for autosave
  4. go back to "all translations"
  5. load the translation again
  6. an error appears on the console, autosave stops working, publishing doesn't work

@Petar.petkovic do we have any data on how many times this error occurs?

@Petar.petkovic do we have any data on how many times this error occurs?

No, I don't have data, only clues on what could be the underlying problem. If this ends up in priority backlog, I'll gladly pick it up.

@Petar.petkovic do you think it is possible to have metrics on logstash/kibana for javascript errors?

@Petar.petkovic do you think it is possible to have metrics on logstash/kibana for javascript errors?

I don't deal with logging much, it's better to ask @Amire80 who does analytics mostly.

There is no logging of client side errors currently, unfortunately. See T106915: Use Sentry in production for an epic about it. It's coming but I don't know when. Thus we have no idea how common this is other than what we notice ourselves or what users might report.

@Nikerabbit

Thus we have no idea how common this is other than what we notice ourselves or what users might report.

This is what I'm worried about, because I've been finding this error every day for the last days.
BUT I don't know what's the normal user flow, if it involves doing a translation in one go or start a translation and going back to it in order to finish it at a later date

santhosh subscribed.

I was not able to reproduce the case of https://en.wikipedia.org/wiki/Chronology_of_Gabon from en to es. But I was able to reproduce with https://en.wikipedia.org/wiki/Proof_that_%CF%80_is_irrational en to pt.

The corresponding section looked liked like this:

image.png (236×1 px, 9 KB)

So, I can add a null/undefined check to prevent the js error, but I think we need to lookinto the problem of why the Math was adapted like this.

Change 525238 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Prevent js error in mw.cx.TranslationTracker#tokenize

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

Found that if I used Yandex instead of Google, the above section translated correctly

image.png (236×1 px, 12 KB)

image.png (236×1 px, 9 KB)

This example seems a case of T214256: CX2 shows </img> instead of math formulas. Once the current ticket is solved, it may be good to check if T214256 got also resolved as a result.

yes, I think the math support need to improve and that can fix both. First thing to do is avoid sending math sections to MT engines so that they don't mangle it.

Change 525264 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] WIP: Do not pass Math content to MT engines

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

yes, I think the math support need to improve and that can fix both. First thing to do is avoid sending math sections to MT engines so that they don't mangle it.

Tickets that may be relevant:

Change 525264 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Do not pass Math content to MT engines

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

Change 526311 had a related patch set uploaded (by KartikMistry; owner: KartikMistry):
[operations/deployment-charts@master] Update cxserver to 2019-07-29-154005-production

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

Change 526311 merged by KartikMistry:
[operations/deployment-charts@master] Update cxserver to 2019-07-29-154005-production

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

Change 525238 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Prevent js error in mw.cx.TranslationTracker#tokenise

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