webcompat / webcompat.com

Source code for webcompat.com
https://webcompat.com
361 stars 192 forks source link

Unable to search for closed issues #2565

Open softvision-oana-arbuzov opened 6 years ago

softvision-oana-arbuzov commented 6 years ago

URL: https://webcompat.com/ Browser / Version: Firefox Nightly 63.0a1 (2018-08-06) , Chrome 68.0.3440.84 Operating System: Windows 10 Pro, Samsung Galaxy S7 Edge (Android 7.0) - Resolution 1440 x 2560 pixels (~534 ppi pixel density)

Steps to Reproduce:

  1. Navigate to https://webcompat.com/
  2. Tap “All issues” and tap “Closed” filter.
  3. In the “Search” field type the number of a closed issue (e.g. 18155).
  4. Observe results.

Expected Behavior: The searched issue is displayed.

Actual Behavior: No results are displayed.

Note

  1. Not reproducible when selecting other filters (e.g “Need Contact”, “Site Contacted”).
  2. Screenshot attached.
  3. Affected area:
    <form id="x-search-bar" method="get" action="/issues">
    <input id="js-SearchForm-input" class="form-field text-field" name="q" placeholder="Search issues by keyword">
    <button class="nav-button nav-link js-SearchForm-button" type="submit" title="Search for an item." aria-label="Search">
        <svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation" aria-hidden="true">
            <use xlink:href="#svg-search2"></use>
        </svg>
    </button>
    </form>

image

Watchers: @softvision-sergiulogigan @softvision-oana-arbuzov

sv;

laghee commented 6 years ago

I see this behavior happening with all of the filters, not just closed. Digging deeper, it looks like we're sending github api queries looking for stage=some_milestone_title instead of milestone=some_milestone_title:

screenshot 2018-08-07 12 36 29

Could be an error or something that changed on github's end 🤷‍♀️ .

Filtering by status/milestone works, but I think only because category here is correct, otherwise it's sending the wrong status entirely (this is me clicking, in order, all issues, Needs Triage, Needs Diagnosis, Needs Contact, Ready for Outreach, Site Contacted, and Closed:

screenshot 2018-08-07 13 01 40

Fixing seems like it would involve lots of small changes: https://github.com/webcompat/webcompat.com/blob/42781cc3a673b622b9fd0d5b07f6250895160a4b/webcompat/static/js/lib/issue-list.js#L137 https://github.com/webcompat/webcompat.com/blob/d8d18c65b7fd3be1e3a69ed6bd700310f7fdbb22/tests/functional/issue-list-non-auth.js#L345 https://github.com/webcompat/webcompat.com/blob/70248c388b5f89717c8a4dca2a01fcef44d367c3/webcompat/templates/contributors/diagnose-bug.html#L37 (hmm... I was wrong above -- ^this link in the contributor page works, so we must be using stage somewhere on our end)

Not sure if normalize_api_params could be expanded to help at all: https://github.com/webcompat/webcompat.com/blob/b322d2397334403e9528720f8ae60cc8d8d0ae3e/webcompat/helpers.py#L250

miketaylr commented 6 years ago

Yeah, stage is our own invention for historical purposes -- some "stages" were labels, and others a search query. It might be possible to just replace it with milestone now?