openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

Shopfront search box returns all records when none is expected #5467

Open filipefurtad0 opened 4 years ago

filipefurtad0 commented 4 years ago

Description

The search box in the shopfront (/shops) is showing all records when it should return zero results. This appears to be introduced by the latest release 2.9.9 #5433 .

Expected Behavior

No results should be returned if there are no shops matching the text inserted in the search box.

Actual Behaviour

All the shops are being returned.

Steps to Reproduce

  1. Go to /shops
  2. Insert a string in the search box which does not match any criteria in the shop list
  3. Observe all results being returned

Animated Gif/Screenshot

The video from @luisramos0 shows the behaviour of the search box on a staging server with release 2.9.9 deployed, and compares it with a production server:

Peek 2020-05-19 11-27

Workaround

The search box can still be used, but only when the input partially matches the existing shops.

Severity

bug-s4: it's annoying, but you can use it

Your Environment

luisramos0 commented 4 years ago

Hmm.. I cant see what's going on here so I tried findind out what PR introduced this, no luck yet. I can see that both: https://github.com/openfoodfoundation/openfoodnetwork/pull/5156 and https://github.com/openfoodfoundation/openfoodnetwork/pull/5356 did not cause this bug... @Matt-Yorkley any idea?

kirstenalarsen commented 4 years ago

as an s3 why is this in dev-ready when no instance has nominated it? Not sure if I am missing something but moving it back to all the things - happy to be overruled @filipefurtad0 @luisramos0 @RachL @lin-d-hop

kirstenalarsen commented 4 years ago

I agree it is horrible - but to use the process we need an instance to select it as it's most horrible before it can cut in front of all the others

RachL commented 4 years ago

@kirstenalarsen you validated yourself the position a few days ago: https://openfoodnetwork.slack.com/archives/CAVTM01QB/p1590060958274400 :-) so you have changed your mind about it?

luisramos0 commented 4 years ago

yes, we agreed we would fix these regressions. I am ok if you want to change that decision :+1:

luisramos0 commented 4 years ago

and I am sorry for not mentioning the slack conversation behind this in the first place: image

jeduardo824 commented 4 years ago

Hey guys, I opened a PR with a suggested fix. The showed shops above are the "distance matches" shops. We can erase them too, but since I don't know the expected behavior from the product view, I only fixed it to show the message "No results found."

Matt-Yorkley commented 4 years ago

There's various cases where the search can return results if the term doesn't match and enterprise name. Like entering a location gives results based on distance from that location. I think with partial matches it will return a set of results that look similar....

I've just had a play around with this in production though, and it definitely looks a bit weird. The location search is working. When there are no matches it sometimes shows no results, and sometimes it shows all the results. It's not even entirely consistent.