Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entries in Product Search #3287

Closed
anshpathania7 opened this issue Nov 7, 2022 · 6 comments
Closed

Duplicate entries in Product Search #3287

anshpathania7 opened this issue Nov 7, 2022 · 6 comments
Labels
🐛 bug Something isn't working

Comments

@anshpathania7
Copy link
Contributor

anshpathania7 commented Nov 7, 2022

What

  • The entries are getting duplicated in product search page

Reason behind this behaviour

  • This is happening because String is not being trimmed, "redbull", " redbull ", "redbull ".

  • These are treated as 3 separate entries.

Steps to Reproduce

  1. Search any product, then search again with some spaces before/after product name.

Expected behavior

Not to show duplicated entries

Screenshot

Screenshot_2022-11-08-00-13-07-653_org.openfoodfacts.scanner.jpg

Smartphone model

  • Device: Poco X3 Pro
  • OS: Android 12
@AshAman999
Copy link
Member

Indeed, there's this problem, perhaps these files would be interesting for you
packages\smooth_app\lib\pages\scan\search_page.dart

@monsieurtanuki
Copy link
Contributor

@anshpathania7 I suggest that we systematically trim the user keywords when she clicks on the "search!" button: no duplicate in search history, and same result on the server.
In addition to that, maybe run a one-shot data cleaning to remove duplicates (but we're ok without that).

@anshpathania7
Copy link
Contributor Author

anshpathania7 commented Nov 8, 2022

By systematically you're referring to trim keywords in the search bar itself right? Also for server-side, shouldn't there be a check or data validation for keywords on server code(I'm guessing it's already there).

And, yes I don't think there's any need of one shot data clearing currently.

@monsieurtanuki
Copy link
Contributor

By systematically...

I mean we let the user type whatever, but what we send to the server and we store in the history is to be trimmed before.

@anshpathania7
Copy link
Contributor Author

Cool, This will be easy fix but should I patch this up for search query only? or There are other places in app where input needs to be trimmed? @monsieurtanuki @AshAman999

@monsieurtanuki
Copy link
Contributor

@anshpathania7 There are not that many user inputs. If you can fix this one, that's good enough for the moment.

Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Development

No branches or pull requests

3 participants