Page MenuHomePhabricator

ContentTranslation makes a request to cxserver.wikimedia.org for each page view when beta is enabled
Closed, ResolvedPublic1 Story Points

Description

I have enabled the Beta, and now upon every dom ready of a page view, I get an XHR request to https://cxserver.wikimedia.org/v1/languagepairs

I suspect the team is planning to make sure to avoid that extra dns lookup eventually ? But more importantly. Why is it making that request in the first place ? I see nothing in the initial page state that would seem to require the information downloaded in this request. It seems that some of the JS modules get initialized even though they are not required ?

Event Timeline

TheDJ created this task.Aug 25 2015, 9:46 PM
TheDJ updated the task description. (Show Details)
TheDJ raised the priority of this task from to Needs Triage.
TheDJ added a project: ContentTranslation.
TheDJ added a subscriber: TheDJ.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 25 2015, 9:46 PM
Amire80 set Security to None.

This is by design - it's done for showing the gray interlanguage link.

Now that I think of it, however, in the past we only had ContentTranslation enabled in some languages and we had to validate whether a certain target language can be shown. Now that it's enabled everywhere, we can probably remove it.

Amire80 triaged this task as Normal priority.Aug 27 2015, 7:04 AM
Amire80 renamed this task from Extensions makes request to cxserver.wikimedia.org for each page view when beta is enabled to ContentTranslation makes a request to cxserver.wikimedia.org for each page view when beta is enabled.
Amire80 moved this task from Backlog to Tech Debt on the ContentTranslation-Release6 board.
Amire80 moved this task from Needs Triage to CX6 on the ContentTranslation board.
Arrbee raised the priority of this task from Normal to High.Aug 27 2015, 8:16 AM
Arrbee added a project: LE-CX6-Sprint 4.
TheDJ added a comment.Aug 27 2015, 9:40 AM

it's done for showing the gray interlanguage link.

The what now, where now ? :)

it's done for showing the gray interlanguage link.

The what now, where now ? :)

If, for example, you translated something from English to Dutch, you chose Dutch as the target language, and this target is saved in local storage. Next time you read an article in the English Wikipedia that doesn't have an (actual) interlanguage link to Dutch, ContentTranslation will identify that you translated to Dutch once, and it will show you a gray interlanguage link to "Nederlands" at the top of the interlanguage links list, which will be a quick entry point to translate that article.

The request you are asking about is done to validate that Dutch is a valid target language for translation from English, but since all languages are now valid targets for translation (at least in all Wikipedias), this request is probably not needed any longer and can be skipped (again, at least in Wikipedias; it might still be useful for other sites).

Nikerabbit moved this task from Backlog to In Progress on the LE-CX6-Sprint 4 board.

Change 237084 had a related patch set uploaded (by Nikerabbit):
Do not call cxserver to display gray interwiki link

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

santhosh moved this task from In Review to Done on the LE-CX6-Sprint 4 board.Sep 10 2015, 4:44 AM

Change 237084 merged by jenkins-bot:
Do not call cxserver to display gray interwiki link

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

This issue is resolved, but the fix caused T113026.

I cannot quickly think of another way to fix it without this request. @Nikerabbit?..

Arrbee moved this task from Done to In Progress on the LE-CX6-Sprint 4 board.Sep 22 2015, 7:23 AM
Arrbee lowered the priority of this task from High to Normal.
Arrbee raised the priority of this task from Normal to High.
Arrbee added a subscriber: Arrbee.

Change 240076 had a related patch set uploaded (by Santhosh):
Do not call cxserver to display gray interwiki link

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

Change 240076 merged by jenkins-bot:
Do not call cxserver to display gray interwiki link

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

Arrbee moved this task from In Progress to QA on the LE-CX6-Sprint 4 board.Sep 23 2015, 7:06 AM
Arrbee moved this task from Backlog to QA on the LE-CX6-Sprint break board.

it's done for showing the gray interlanguage link.

By the way, is there a screenshot of one such gray interlanguage link? I only ever saw red ones.

Here you go:

They were changed from red to gray a while ago.

If you have the Content translation beta feature enabled your browser language or accept-language is Italian and if you selected Italian in ULS (in the same wiki - previous languages are per domain), you should see it as a gray link if an article is not translated. If you don't, it's a bug.

Arrbee moved this task from QA to Done on the LE-CX6-Sprint break board.Oct 5 2015, 7:14 AM
Arrbee moved this task from QA to Done on the LE-CX6-Sprint 4 board.Oct 7 2015, 4:29 AM
Arrbee closed this task as Resolved.Oct 7 2015, 4:37 AM

@Arrbee and @Nikerabbit confirmed that this is not happening any more. Closing.