Skip to content

Search cleanses concurrent spaces when autocompleting milestone names

Summary

When a milestone name has more than one concurrent space (ex- "Two Spaces"), a search against the milestone will not return any results if the milestone is referenced via auto-completion.

Steps to reproduce

  1. Create a milestone whose name has two concurrent spaces (ex - "Two Spaces").
  2. Add the milestone to an issue.
  3. Attempt to search via milestone using auto-complete.
  4. The issue tied to the milestone does not appear.

Example Project

This is the URL searched on when using an auto-complete based search: https://gitlab.com/groups/gcardona-test-group/-/issues?scope=all&utf8=%E2%9C%93&state=opened&milestone_title=Two%20Spaces If I add another space after the autocomplete is done or within the URL itself, the results show up: https://gitlab.com/groups/gcardona-test-group/-/issues?scope=all&utf8=%E2%9C%93&state=opened&milestone_title=Two%20%20Spaces

What is the current bug behavior?

Searching for issues via a milestone with two concurrent spaces in the name does not return any results when using autocomplete.

What is the expected correct behavior?

Autocomplete does not perform a cleansing of concurrent spaces. Alternatively, any space cleansing done on autocomplete should also be applied when creating/updating the milestone name for consistency.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

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