Page MenuHomePhabricator

While using ParsoidBatchAPI, [[Media: ]] does not link to media file anymore
Closed, ResolvedPublic

Description

Moving to Parsoid 1.5.0 I ran the MCS diff tests. There I noticed that [[Media: ]] links behave very differently now.

[[media:Classical guitar scale.ogg|Sound]]

used to produce something like

<a href="./Media:Classical_guitar_scale.ogg" title="Media:Classical guitar scale.ogg">Sound</a>

Now it produces a link to a generic file type icon:

<a href="//en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png" title="fileicon-ogg.png">Sound</a>

You can observe this on my test page https://en.wikipedia.org/api/rest_v1/page/html/User%3ABSitzmann_(WMF)%2FMCS%2FTest%2FFrankenstein#Media.

Event Timeline

This was done in T151277 and was part of 1.4.0 according to the changes listed in the spec https://www.mediawiki.org/wiki/Specs/HTML/1.4.0

It looks like the href is mistakenly being set to thumb url, instead of the media itself.

echo "[[media:Classical guitar scale.ogg|Sound]]" | node bin/parse --normalize

does the right thing,

<p><a href="//upload.wikimedia.org/wikipedia/commons/5/53/Classical_guitar_scale.ogg" title="Classical guitar scale.ogg">Sound</a></p>

but

echo "[[media:Classical guitar scale.ogg|Sound]]" | node bin/parse --normalize --useBatchAPI

does not,

<p><a href="//en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png" title="fileicon-ogg.png">Sound</a></p>

So, the difference is the --useBatchAPI option. When/where/why is it used?

So, the difference is the --useBatchAPI option. When/where/why is it used?

batch api use is default in production which is how you noticed this bug. so, looks like we had a gap in our testing here.

ssastry renamed this task from [[Media: ]] does not link to media file anymore to While using ParsoidBatchAPI, [[Media: ]] does not link to media file anymore.Jul 1 2017, 2:46 PM
ssastry triaged this task as High priority.

Change 363046 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] T169293: Media links should point to url not thumb

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

Change 363046 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T169293: Media links should point to url not thumb

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

@Arlolra I see you have closed this ticket. Has this been deployed yet? https://en.wikipedia.org/api/rest_v1/page/html/User%3ABSitzmann_(WMF)%2FMCS%2FTest%2FFrankenstein still shows the Sound link pointing to the png instead of the ogg file.

Probably best to keep this open until this is deployed.

Usually we close when the patch is merged to master, and then SAL comes around and marks it as deployed. But, sure, no problem.

Did you want this to go out today? If there's no rush, we may delay until tomorrow.

@Arlora. Oh, ok. I didn't know you had a different policy in Parsoid land. How do you get SAL to mark this as deployed? Might be good for me to do as well.

I guess tomorrow is fine, too. It's really for the Android app.

Mention the task number in the admin log,

!log Bla bla bla (TXXXXXX)

I purged your test page after the deployed and the content is now,

<a rel="mw:MediaLink" href="//upload.wikimedia.org/wikipedia/commons/5/53/Classical_guitar_scale.ogg" title="Classical guitar scale.ogg" id="mwJA">Sound</a>

Thanks. My Frankenstein page get the working audio link now.

There are a couple of more pages that have issues. I ran the action=purge on these but looks like it hasn't had any effect yet or there is another issue. These pages don't have the right pronunciation link. The pages are (all on enwiki):

  • Altrincham
  • Sunderland_A.F.C.
  • Barack_Obama
  • Uranus
  • Odisha
  • Yazidis

I thought the pronunciation issue was related and would be fixed with this as well. Looks like that was not correct.

Change 365201 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Hygiene: updates diff test results for Media links

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

There are a couple of more pages that have issues.

{{IPAc-en|audio=En-uk-Altrincham.ogg|ˈ|ɒ|l|t|r|ɪ|ŋ|əm}}

expands to (the relevant part)

[[:Media:En-uk-Altrincham.ogg|listen]]

which Parsoid parses as,

<p data-parsoid='{"dsr":[0,38,0,0]}'><a rel="mw:WikiLink" href="./Media:En-uk-Altrincham.ogg" title="Media:En-uk-Altrincham.ogg" data-parsoid='{"stx":"piped","a":{"href":"./Media:En-uk-Altrincham.ogg"},"sa":{"href":":Media:En-uk-Altrincham.ogg"},"dsr":[0,38,30,2]}'>listen</a></p>

whereas,

[[Media:En-uk-Altrincham.ogg|listen]]

now gives,

<p data-parsoid='{"dsr":[0,37,0,0]}'><a rel="mw:MediaLink" href="//upload.wikimedia.org/wikipedia/commons/1/1a/En-uk-Altrincham.ogg" title="En-uk-Altrincham.ogg" data-parsoid='{"dsr":[0,37,null,null]}'>listen</a></p>

So, yes, different issue but still a problem. I will look into it.

Change 365201 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Hygiene: updates diff test results for Media links

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

@Arlolra should we reopen this or create a new subtask?

Change 365403 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] [WIP] T169293: Colon prefixed media links still point to media

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

Let's just reopen here. I have a WIP that fixes it.

Change 365403 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T169293: Colon prefixed media links still point to media

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

The pages are (all on enwiki):

  • Altrincham
  • Odisha

I purged and verified these pages.