Page MenuHomePhabricator

MediaViewer does not work well on private wikis (in Chrome?)
Closed, ResolvedPublic

Description

Migrated from: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/562

Steps to reproduce

  • Go to private wiki using Chrome
  • View file in mmv

Expected behavior

Picture should show up

Actual behavior

Error

Theory

Setting cors=false in the image provider's getRaw method fixed the issue; because we set cors=anonymous on the image element it fails to set credential headers on the image request. Need to add a way to tell if a wiki is private on the client side and act accordingly.

Related Bugs

Related Stories

Related Changesets

Event Timeline

MingleTerminator raised the priority of this task from to High.Dec 8 2014, 5:47 PM
In mingle on 2014-05-02 at 22:39:31, @Tgr wrote:

Not setting cors results in the image being downloaded twice on some browsers (Firefox IIRC). Possible strategies:

  • on wikis where we do not measure performance, do no do AJAX preloading (then the cors img attribute is not needed either). This would break the progress bar (it would only show 0% and 100%) which is also based on the AJAX preload.
  • set the cors attribute to use-credentials if this is a private wiki. (Need to check if that really avoids a double download the same way setting it to anonymous does.)
In mingle on 2014-05-02 at 22:42:07, @Tgr wrote:

There does not seem to be an easy way to tell if a wiki is private. If FileRepo::getZoneUrl('thumb') is empty, the wiki is private, but it is not clear whether the reverse is true.

Also, the repo can have per-extension zone URL configurations.

In mingle on 2014-05-02 at 22:47:35, @Tgr wrote:

The same problem affects public wikis with a remote repo which does not set CORS headers: https://bugzilla.wikimedia.org/show_bug.cgi?id=62469

In mingle on 2014-05-02 at 22:48:39, @Tgr wrote:

I guess a half-hearted fix would be to just retry the image loading without the cors flag if it fails.

Tgr lowered the priority of this task from High to Medium.Dec 11 2014, 12:45 AM

Lowering priority as we do not plan to work on this anytime soon.

Tgr renamed this task from Chrome + private wiki = explosion to MediaViewer does not work well on private wikis (in Chrome?).Dec 11 2014, 3:13 AM
Tgr reopened this task as Open.
Tgr set Security to None.
Tgr added subscribers: Unknown Object (MLST), Tgr, MarkTraceur and 3 others.

Needs to be retested since T65282 was resolved recently.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

Jdlrobson claimed this task.
Jdlrobson subscribed.

Cannot reproduce.