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.

Details

Related Gerrit Patches:
mediawiki/services/mobileapps : masterHygiene: updates diff test results for Media links

Event Timeline

bearND created this task.Jun 30 2017, 2:58 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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.
Arlolra claimed this task.Jul 3 2017, 3:10 AM

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 closed this task as Resolved.Jul 5 2017, 4:55 PM

@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.

Nope. It was supposed to go out last Thursday but has been delayed 'til tomorrow (hopefully).

See https://www.mediawiki.org/wiki/Parsoid/Deployments#Thursday.2C_July_6.2C_2017_around_10:15_am_PT:_f203923e_to_be_deployed

bearND reopened this task as Open.Jul 11 2017, 4:03 PM

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)

Mentioned in SAL (#wikimedia-operations) [2017-07-13T18:31:08Z] <arlolra> Updated Parsoid to rGPAR71c07681db3b (T169293)

Arlolra closed this task as Resolved.Jul 13 2017, 6:34 PM

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>
bearND added a comment.EditedJul 14 2017, 5:04 AM

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

Arlolra reopened this task as Open.Jul 14 2017, 9:03 PM

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

ssastry moved this task from Backlog to In Progress on the Parsoid board.Jul 19 2017, 9:43 PM

Mentioned in SAL (#wikimedia-operations) [2017-07-20T17:54:50Z] <arlolra> Updated Parsoid to rGPARa89a9cc4a0ab (T169293)

Arlolra closed this task as Resolved.Jul 20 2017, 6:00 PM

The pages are (all on enwiki):

  • Altrincham
  • Odisha

I purged and verified these pages.