Page MenuHomePhabricator

[M] MediaSearch: invalid search queries never finish loading - no warning to users
Closed, ResolvedPublic

Description

The issue is present on production (commons wmf.27) and on commons betalabs.

  1. On Special:MediaSearch perform an invalid search, e.g. + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /
  2. The animation for loading results will be displayed but the page never finishes loading. No user message/warning will be displayed.

Screen Shot 2021-02-03 at 6.21.40 PM.png (473×885 px, 50 KB)

Note: Special:Search will promptly display the following warning to users:
Screen Shot 2021-02-03 at 6.13.26 PM.png (301×1 px, 52 KB)

Acceptance Criteria

  • If the user enters invalid search input, display the same error message shown for T271387
  • Ensure that the error message is displayed when the invalid search request happens in PHP (non-JS users or bad URL params)
  • Ensure that the error message is displayed when the invalid search request happens in JS (user enters bad query after page initializes)

Details

Event Timeline

T271387 is when filters have an invalid value that we don't know how to handle in the UI (it's not one of the values that could be chosen in one of the dropdowns). It can only be achieved by manually mishandling the URI (or via software that messes up links) since we provide no controls to construct a search like that.
This is actual search input (can simply be entered in the search input field) that the search engine just happens to fail to process and make sense of. It's a rather extreme edge case, but it's plausible that it happens by accidental user input.
(FWIW, I think we can give both the same generic error msg treatment)

Thanks @matthiasmullie, that makes sense.

Yeah, following the same sort of message works for me. Maybe this one keeps the search chrome though.

01.jpg (656×1 px, 83 KB)

There is now a patch up for T271387, so once that is merged we can probably tackle this quickly and apply the same behavior. I'll update the acceptance criteria in this ticket to make it clear that this concerns errors due to invalid search terms as opposed to invalid filter settings.

Thanks @matthiasmullie, that makes sense.

Yeah, following the same sort of message works for me. Maybe this one keeps the search chrome though.

01.jpg (656×1 px, 83 KB)

I think that when a "bad input" search is initiated from the JS UI, this is what we'd want to show the user (because the rest of the search chrome was already there when the user submitted the bad query).

If the bad input is present on the PHP side (perhaps because the user copied/pasted a link that included bad query parameters), we may want to handle things in the same way we do for T271387 where the rest of the chrome is never added to the page; we'd probably want bail early as soon as we detect that something is wrong (this is how we're handling invalid filter settings).

I agree that the same message and icon from the invalid filter can be re-used here (in both scenarios).

Change 668758 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Handle invalid search strings

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

egardner renamed this task from MediaSearch: invalid search queries never finish loading - no warning to users to [M] MediaSearch: invalid search queries never finish loading - no warning to users.Mar 5 2021, 6:26 PM
egardner claimed this task.

Here's a side-by-side example of the PHP and JS versions of this error message:

PHP version (user copies/pastes a bad link, has bad params in their URL, etc):

Screen Shot 2021-03-05 at 11.29.53 AM.png (2×2 px, 723 KB)

JS version (user enters bad input after page JS initializes)

Screen Shot 2021-03-05 at 11.29.43 AM.png (2×2 px, 764 KB)

In the latter case, clearing the bad search term also clears this message and returns to the empty state, so they can try again.

Both messages display an identical link that just reloads the page with no parameters if clicked.

Change 668758 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Handle invalid search strings

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

Tested in betalabs (also see this comment in T271387.

JS - bad user inputno-JS bad user input
Screen Shot 2021-03-12 at 5.11.45 PM.png (446×859 px, 50 KB)
- type filters are present; - "Enter a new search" is not a link
Screen Shot 2021-03-12 at 5.11.18 PM.png (451×917 px, 43 KB)
- tab filters are present; - "Enter a new search" is not a link (it shouldn't?)

@egardner - please review the following questions

  • the screenshots from betalabs look different than in your comment
  • should the error message (and UI) be different between the case when there is a bad user input in the search textbox and when a user pastes the url with invalid search criteria (and correct url parameters)?

For commons wmf.36 two specs are missing (per the screenshots in @egardner comment

  • "Enter a new search" is not a link
  • PHP version (no-JS) still includes the search text field

I'll do additional check on commons wmf.37.

Hi @Etonkovidova – in recent weeks we were able to improve the error handling so that both JS and non-JS users saw the same thing essentially – the complete search UI (input, tabs, etc) with the error message in the area below. There is no longer a need for a link to restart a new search, because the user can just do so immediately without navigating. I think it is safe to say that our acceptance criteria have changed slightly now.

Hi @Etonkovidova – in recent weeks we were able to improve the error handling so that both JS and non-JS users saw the same thing essentially – the complete search UI (input, tabs, etc) with the error message in the area below. There is no longer a need for a link to restart a new search, because the user can just do so immediately without navigating. I think it is safe to say that our acceptance criteria have changed slightly now.

Thanks for the clarification - I thought that the specs (the link and the difference between js and no-js) have been changed. Closing as Resolved.