Page MenuHomePhabricator

No instant search suggestion shown for a specific user after entering search terms on www.wikipedia.org
Closed, ResolvedPublic

Description

Reported at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Instant_Search_Suggestion_disappeared

@Ergo_Sum (using chrome) no longer sees search suggestions when typing in the search box, including after clearing their cache

Edit by Ergo: Apologies for not including enough information. When I go to the Wikipedia homepage (www.wikipedia.org), and a type in the search box, the drop-down list of suggested searches does not appear. in the past, it always did, and I have not made any changes to my Wikipedia account settings, browser settings, etc. My browser is Google Chrome v80.0.3987.149. To try to resolve the issue, I have tried logged out and back into Wikipedia, restarting my computer, clearing all my browser's history, cookies, and cache, and uninstalling and re-installing Chrome. So far, no luck.

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Just wanted to clarify. I get no errors when I'm on the home page, but I do get errors in the console when on the enwiki main page.

Aklapper changed the task status from Open to Stalled.Mar 28 2020, 8:47 PM

Unfortunately this Wikimedia Phabricator task lacks some information.
If you have time and can still reproduce the situation: Please add a more complete description to this task. That should be

  • a clear list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step,
  • what happens after performing these steps to reproduce,
  • what you expected to happen instead,
  • a full link to a web address where the issue can be seen.
  • exact browser and browser version information.

You can edit the task description by clicking Edit Task. Ideally, a good description should allow any other person to follow these steps (without having to interpret steps) and see the same results. Problems that others can reproduce can get fixed faster.

Cannot reproduce in Chromium 80, results are shown.
Does this also happen when disabling any browser add-ons and using a new browser profile?
Does this also happen in another browser (which one)?
Which entries does the "Network" tab of Chrome's developer tools show when entering a search query into the search field?
See https://developers.google.com/web/tools/chrome-devtools for Chrome and Chromium

I disabled the only non-Google browser add-on that I have and it didn't make a difference. I tried using Safari and have no problem. I tried using the Chrome guest profile, and the problem is also resolved. I'm not sure why this is, since I hadn't changed any of my Chrome profile settings before this issue started.

If I'm understanding you correctly, when I enter something in the search box inside the developer window when on the Wikipedia homepage, I get the error: error: {code: "badinteger", info: "Invalid value "176.00000381469727" for integer parameter "pithumbsize".",…}

Aklapper renamed this task from Instant Search Suggestion at www.wikipedia.org doesn't work for everyone to No instant search suggestion shown for a specific user after entering search terms on www.wikipedia.org.Mar 29 2020, 10:58 PM
Aklapper changed the task status from Stalled to Open.

It would be great to clear steps to reproduce (means: exact search term entered) and have the complete error including the URL.

I do not know what you mean by complete error. The URL is https://www.wikipedia.org. I have tried entering many search terms. For example, one that does not work is entering "Wikipedia" in the search field. I do not press enter after typing it in, so I don't know what other URL you are referring to.

Edit: Forgive me, do you mean the link from the developer console? If so, it is: https://en.wikipedia.org/w/api.php?action=query&format=json&generator=prefixsearch&prop=pageprops%7Cpageimages%7Cdescription&redirects=&ppprop=displaytitle&piprop=thumbnail&pithumbsize=176.00000381469727&pilimit=6&gpssearch=Wikip&gpsnamespace=0&gpslimit=6&callback=callbackStack.queue%5B5%5D.
There are many errors listed, but it looks like they're all the same. The full error that prints out at that link is:
/**/callbackStack.queue[5]({"error":{"code":"badinteger","info":"Invalid value \"176.00000381469727\" for integer parameter \"pithumbsize\".","*":"See https://en.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1396"})

@Ergo_Sum thanks. That error message actually does help a lot.

What's happening there is that the API is requesting a thumbnail with the size 176.00000381469727px, which is invalid because the API expects that number to be an integer. The entire API response fails at that points and doesn't return any results.

The code determining that number is located on mw-typeahead.js#29:

thumbnailSize = getDevicePixelRatio() * 80

Which requests a thumbnail that is relative to pixel density of the users device. So if the pixel density is not an integer (in this case the pixel density is 2.2) then the search typeahead fails! The solution is to wrap that value in parseInt().

I'm surprise this bug hasn't been raised earlier...

This sounds like a problem that is not possible for me to fix, no?

@Ergo_Sum nope, but I can work on this issue this week & deploy the fix next Monday. (there is one issue blocking deploys that I have to fix before this).

Change 585489 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[wikimedia/portals@master] Ensure typeahead thumbnail size is an integer

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

Change 585489 merged by jenkins-bot:
[wikimedia/portals@master] Ensure typeahead thumbnail size is an integer

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

@Ergo_Sum this should be resolved now, please confirm and we can close out the ticket.

@Jdrewniak Yes, it is resolved now. Thank you.