Page MenuHomePhabricator

[wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special page
Closed, ResolvedPublic3 Estimated Story Points

Description

Switch to MinervaNeue skin and enter "Special:" in the Search box. The suggestion list is displayed and the selection can be made.
However, the following Console error will be displayed:

Uncaught TypeError: Cannot convert undefined or null to object
    at hasOwnProperty (<anonymous>)
    at addBinding (<anonymous>:239:1)
    at Watchstar.oo.EventEmitter.on (<anonymous>:239:212)
    at HTMLLIElement.<anonymous> (<anonymous>:576:167)
    at Function.each (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:4:939)
    at jQuery.fn.init.each (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:2:505)
    at <anonymous>:575:2391
    at fire (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:46:617)
    at Object.fireWith [as resolveWith] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:47:824)
    at Object.deferred.(anonymous function) [as resolve] (https://en.wikipedia.beta.wmflabs.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=minerva&version=14kbqyi:51:337)

Developer notes

The error shows when searching for "Special:Nearby".
We only allow the watching of pages which have an id and all special pages by design have no pageid.

So before firing off the watchlist query we should filter out any results which do not have an id.

Acceptance criteria

  • Watchstar does not show up next to special pages
  • If all search results are special pages no request to the watch API is made
  • Pages without ids are not sent to the watch api.

@pmiazga: Not possible to verify without hacking as the watchstar is not present for Special:Articles. Because there is no element to trigger the watchAPI request there is no possibility to send page without id. I call it done

Testing criteria

  • Can be tested on beta cluster on the mobile website

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 9 2018, 9:55 PM
Etonkovidova renamed this task from [wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special to [wmf.20-regression] MinervaNeue - "Uncaught TypeError: Cannot convert undefined or null to object" when search for Special page.Feb 9 2018, 9:55 PM

Are we sure this is a regression and this worked in wmf.9? The code hasn't changed in a long time so this surprises me!

Possible duplicate of T186147.

Niedzielski moved this task from Needs triage to Triaged on the Mobile board.Feb 14 2018, 4:38 PM
Jdlrobson reopened this task as Open.Feb 26 2018, 7:40 PM
Jdlrobson updated the task description. (Show Details)

I've reopend this based on new information. Added developer notes and should be ready for estimation.

Jdlrobson triaged this task as High priority.Feb 27 2018, 5:11 PM

noting another bug:

  1. as a logged in user, search for any special page, example special:nearby
  2. select star to add special page to watchlist
  3. search for any other special page

Observed: all special pages are displayed as being in watchlist

Jdlrobson updated the task description. (Show Details)Feb 27 2018, 5:37 PM
ovasileva set the point value for this task to 3.Feb 27 2018, 5:41 PM

Change 415478 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Don't try to load watch stars for special page search results

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

Change 415478 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Don't try to load watch stars for special page search results

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

pmiazga claimed this task.Mar 1 2018, 6:07 PM
pmiazga added a subscriber: ABorbaWMF.
Jdlrobson reassigned this task from pmiazga to ABorbaWMF.Mar 1 2018, 6:07 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: pmiazga.

Looks good to me on Beta

ovasileva updated the task description. (Show Details)Mar 1 2018, 6:37 PM
pmiazga claimed this task.Mar 1 2018, 7:25 PM

Looks like Anthony tested that, I'll sign off this task

pmiazga closed this task as Resolved.Mar 1 2018, 7:53 PM
pmiazga updated the task description. (Show Details)
pmiazga removed a project: Patch-For-Review.