Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-7405

Inline search claims there are no results when the search returns an error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2014-06-23
    • None
    • Search
    • None

      The standalone search handles errors at https://bitbucket.org/metabrainz/musicbrainz-server/src/4c753d3963210fb4cae039c9fe33637b89d1434a/lib/MusicBrainz/Server/Controller/Search.pm?at=beta#cl-220
      When we get the "read timeout" error from the search server, it uses the internal-error.tt template.

      First I broke all searches by adding:

      diff --git a/lib/MusicBrainz/Server/Data/Search.pm b/lib/MusicBrainz/Server/Data/Search.pm
      index b69643a..dc792cd 100644
      --- a/lib/MusicBrainz/Server/Data/Search.pm
      +++ b/lib/MusicBrainz/Server/Data/Search.pm
      @@ -762,6 +762,10 @@ sub external_search
       
           # Dispatch the search request.
           my $response = get_chunked_with_retry($ua, $search_url);
      +
      +# break all the searches! >D
      +return { error => "read timeout whatever", code => 500 };
      +
           if (!defined $response) {
               return { code => 500, error => 'We could not fetch the document from the search server. Please try again.' };
           }
      

      Then I checked that the standalone search displays the error message as I expected. Then I tested with the inline search, but that just displays "(No results)", which is incorrect - we don't know if there are any results or not because the search failed. At the very least, it should display something which indicates that the search failed.

      Investigating further, I guess https://bitbucket.org/metabrainz/musicbrainz-server/src/4c753d3963210fb4cae039c9fe33637b89d1434a/lib/MusicBrainz/Server/Controller/WS/js/Role/Autocompletion.pm?at=beta#cl-83 is where it needs fixing.

            bitmap Michael Wiencek
            nikki nikki
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2014-06-23