HomePhabricator

Fix for image peeking not working for many images.

Description

Fix for image peeking not working for many images.

The problem is the decision whether to peek for an image was
controlled by MWKImageList's "hasImageURL" method, which checked
if the article's image list has a match for an image. This check
is based on image url, but the image list no longer seems to
have the exact urls which the image tag's "src" used.

The reason things are out of sync is we are building the
imageList when the article data is saved post-fetch, but the
image tag "src" attribute value isn't changed until after
this - at the time the html is about to be used.

One potential fix would be to change the image tag's "src"
values *before* we save the article data, but we can't do
that because the "secret" string we place in the url changes
between app cold starts. This means the proxy server would
ignore these requests after a restart.

I'm going to investigate doing away with the imageList
entirely. Benefits would include being able to do away with
all imageList logic *and* no longer having to do an XPath
parse before saving the article html.

Details

Provenance
MhurdAuthored on Jun 25 2016, 6:46 PM
Parents
rAPIOS65355f5812d4: Merge pull request #739 from wikimedia/spike/promisekit_removal
Branches
Unknown
Tags
Unknown
ChangeId
None