Page MenuHomePhabricator

Reduce Page Images queries count for MobileFrontend watchlist page
Closed, ResolvedPublic

Description

MobileFrontend SpecialMobileEditWatchlist file has flawed logic when it comes to retrive the PageImages.

The executeViewEditWatchlist() function first calls a SpecialMobileEditWatchlist::images hook to retrieve all page images for current query (PageImages extension listens to that hook and returns an array of images), then for each Article it:

  • if the image exists in the $images array - use it
  • otherwise call PageImages::getPageImage() to get the image

Most probably the call to the PageImages is not necessary, as we already asked PageImages for image for given article and it just doesn't exist. There is no need to do the SQL query once again.

Is there any special case, where we have to execute PageImages::getPageImage()? If no, we should get rid of that code.

Event Timeline

pmiazga created this task.Nov 20 2018, 4:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 20 2018, 4:54 PM
D3r1ck01 added a subscriber: D3r1ck01.

Change 474958 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@master] SpecialMobileEditWatchlist shouldn't query PageImages extension twice

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

Change 474958 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] SpecialMobileEditWatchlist shouldn't query PageImages extension twice

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

phuedx closed this task as Resolved.Nov 22 2018, 1:56 PM
phuedx claimed this task.
phuedx added a subscriber: phuedx.

Being bold.

Being bold.

Dependency has been dropped from MobilePage, should be fine :)