Page MenuHomePhabricator

Backwards compatibility broken when scripts manually use thumbnail links of nonstandard size
Closed, DeclinedPublicBUG REPORT

Description

A recent change has broken backwards compatibility when hard linking to thumbnails that are of a non standard size (say 31px) specified in a LocalSettings file. This also affects off wiki downloading and embedding as well.

Steps to replicate the issue (include links if applicable):

  • I link to a thumbnail for an image hosted on wiki of a nonstandard size (i.e. upload.wikimedia.org/wikipedia/.../Imagename.svg/31px-Imagename.svg)

What happens?:

A 429 error is received.

What should have happened instead?:

The next largest image of a standard size OR a nonstandard size image generated on the spot should have been served for that one request.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Not applicable as it happening on WMF wikis with their scripts.

Other information (browser name/version, screenshots, etc.):

See https://en.wikipedia.org/wiki/User:Awesome_Aasim/searchengine.js as an example script.

If the error message is kept, the 429 error should be replaced with either 400 bad request or 410 gone.

Event Timeline

cc @Ladsgroup this might be something in your wheelhouse since I remember seeing you post about this on wikitech-l.

Regarding the task title, I do not see a bug but intentional behavior. See https://www.mediawiki.org/wiki/Common_thumbnail_sizes

You will have to use size on your icons:
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/background-size

And yes, this is because T414805 was rolled out despite objections even from WMF senior dev...

I have looked at the list of non-standard thumbs coming from gadgets, user-scripts, template styles, or .css files and I have fixed anything that got more than 5,000 requests a day (with some small exceptions here and there) but for example, you can see my fixes in Polish Wikipedia: https://pl.wikipedia.org/w/index.php?title=MediaWiki:Gadget-padlock-indicators.js&diff=prev&oldid=79566378 and https://pl.wikipedia.org/w/index.php?title=MediaWiki:Common.css&diff=prev&oldid=79554110 and use that to fix your gadget.

Our thumbnail URLs are not stable interface and as such, won't be providing backward compatibility. We have announced this for a while now (https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/message/LS2NVZTBZPQDK2W7IP66SHUXP2J54435/ three months ago) and I personally fixed anything heavily used (more than 5,000 requests a day) but the rest is the responsibility of gadget maintainers to fix.

We will be switching the http status to 400 soon. That is planned and on the way.

Declined as above.