Group and Project search endpoints are inconsistent and show Nothing found…

Summary

When searching for a group or project at /search we sometimes experience an inconsistency in the results. Sometimes, typing in a known group or project will result in Nothing found… and re-typing a second or 3rd time will find it. By the looks of it, it seems like we are returning Nothing found... when we get a 304 because it believes the search query was not modified. This seems to happen more often if you are searching quickly or typing quickly, as I suspect this is part of the debouncing/throttling functionality on groups.json and projects.json endpoints.

Steps to reproduce

  1. Navigate to /search
  2. Attempt to search for a known group or project
  3. Search for the name repeatedly and quickly

Example Project

search_filter_example.mov

What is the current bug behavior?

Searching for a group or project that is known to exists sometimes results in Nothing found... Searching again is required to get it to show up.

What is the expected correct behavior?

Searching for a group or project should be more responsive and show up immediately.

Relevant logs and/or screenshots

image

Output of checks

Was able to reproduce it on GitLab.com and on GitLab SM 17.10

Results of GitLab environment info

Expand for output related to GitLab environment info

  (For installations with omnibus-gitlab package run and paste the output of: \\\`sudo gitlab-rake gitlab:env:info\\\`)  (For installations from source run and paste the output of: \\\`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\\\`)   

Results of GitLab application Check

Expand for output related to the GitLab application check

 (For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:check SANITIZE=true\`)  (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true\`)  (we will only investigate if the tests are passing)  

Possible fixes

Edited by 🤖 GitLab Bot 🤖