Page MenuHomePhabricator

Quickly switching filters results in "Invalid search" message
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Actual Results:

  • When you switch to the Audio tab, you'll see the "Invalid search" component for a moment before results display (above the loading indicator)
  • When you switch to the Video tab, you will see the "Invalid search" component and the results will not load

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
AnneT renamed this task from Quickly switching filters results in momentary display of "Invalid search" component to Quickly switching filters results in "Invalid search" message.Mar 19 2021, 3:20 PM
AnneT updated the task description. (Show Details)

I think the problem here does not actually have anything to do with filters. I'm pretty sure that this behavior is because we deliberately abort in-flight requests if the user starts changing tabs (since that triggers a new request). Now that the new error-handling code has been added, these deliberate aborts are being handled the same way as erroneous requests.

So we need a way in our error handling to distinguish between requests that we have deliberately aborted and requests that have failed for legitimate reasons.

Change 673554 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Distinguish between aborted requests and true search errors

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

Change 673554 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Distinguish between aborted requests and true search errors

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

@egardner it seems that it needs more work.

  • On Special:MediaSearch in Images tab enter simple search terms, e.g. "yellow tulips" as in the screen recording below. Click 'Search'
  • While results are being loaded (and when the first results are showing up) click on a different filter - 'Invalid search' will be displayed.
  • "Invalid search" will be displayed in all tabs.Clicking on 'Search' will not re-submit the search. Only reloading the page will perform new search.

invalid_search2.gif (615×1 px, 583 KB)

@Etonkovidova strange, I'll re-test this locally to see if I can get the same results. Maybe I wasn't switching tabs quickly enough.

@Etonkovidova strange, I'll re-test this locally to see if I can get the same results. Maybe I wasn't switching tabs quickly enough.

Switching can be done slower :) My screen recording just shows the extreme case when all tabs display "Invalid search".

Note:It's much more difficult (and often even not possible) to see "Invalid search" in betalabs common. And even when it get displayed, it just flashes, never stays, as I observed on production.

I think it's possible that this patch was not live on production when you were testing, because I don't see this behavior locally (where I'm running the master branch). There has been some train trouble this week, and it looks like wmf.36 has been rolled back from Group 1 and Group 2 at this point.

Let's check this behavior on production again in a week or so once the deployments are back on track.

@Etonkovidova I just tested this in production again, and I'm no longer seeing the invalid search message when rapidly switching between tabs. Behavior on production is finally matching what I've been seeing locally for the last week. Please take a moment to try and verify this yourself when you have time.

I thought this change was included in WMF 36, but we had a lot of train weirdness in the last week. Now everything seems to be on WMF 37 and the patch to correct this bug seems to be working as expected.

@egardner - I did some additional testing in production on different browsers and devices to eliminate the possibility that it happens only on my computer. The issue is reproducible every single time :(

Can you check which server you're hitting with mw.config.get( 'wgHostname' )? I recall one weird case when the issue was that specific.

As far as I could see, the key in reproducing the issue is to switch to an another tab filter before the present tab filter results are fully loaded. Even if the results got loaded to the first and the second tabs, the fact that the switch was done before all results get loaded will produce "Invalid search" in other three tabs.

@Etonkovidova you're right, looks like I spoke too soon. I thought I was able to go rapidly between tabs on prod earlier today without any error messages, but now I'm seeing them again. What's strange is the fix has worked in my local environment the whole time; I'd think production would be faster if anything.

Change 677650 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/extensions/WikibaseMediaInfo@master] Don't show "invalid search" message when request is aborted by user

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

Change 677650 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] Don't show "invalid search" message when request is aborted by user

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

Change 677956 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/extensions/WikibaseMediaInfo@wmf/1.36.0-wmf.38] Don't show "invalid search" message when request is aborted by user

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

Change 677956 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@wmf/1.36.0-wmf.38] Don't show "invalid search" message when request is aborted by user

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

Checked after backporting - worked as expected.