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

Add a project switcher to search (and store the type on each product opened "off", "obf", "opf" and "opff", and for any search we store locally) #5586

Closed
Tracked by #4543 ...
teolemon opened this issue Sep 11, 2024 · 10 comments · Fixed by #5721
Assignees
Labels
🧴 Open Beauty Facts Please see this proposal: https://github.com/openfoodfacts/smooth-app/discussions/1378 🐾 Open Pet Food Facts 📸 Open Products Facts 🔎 Search

Comments

@teolemon
Copy link
Member

teolemon commented Sep 11, 2024

What

  • Add a project switcher to search (and store the type on each product opened "off", "obf", "opf" and "opff", and for any search we store locally)

Mockups

image
https://www.figma.com/design/nFMjewFAOa8c4ahtob7CAB/Mobile-App-Design-(Quentin)?node-id=5816-19916&node-type=canvas&t=1Rms31ZpldZawPl9-0

Part of

@monsieurtanuki
Copy link
Contributor

@teolemon So for the moment the off/obf/opf/opff field isn't stored in the product data (e.g. as 'flavor'), it's just the fact that someone store it and then we found it in off or obf that tells if it's food or beauty, right?

I've just found 4056489368793 in both, so what is it supposed to be?

The primary key of the product would become barcode AND flavor?

@teolemon
Copy link
Member Author

@monsieurtanuki
Copy link
Contributor

In your spreadsheet I see duplicates that need to be solved.
Ok, so once they're solved, you merge the filesystems: does that mean that we'll be duplicate-proof ever after?

Using a universal search would be helpful, instead of up to 4 searches, but as long as the barcode is unique among all 4 systems it's not a problem for Smoothie.

I assume adding flavor as a product field would be easy to implement - once the duplicates are removed. And it will make life much easier in Smoothie.

@monsieurtanuki monsieurtanuki self-assigned this Sep 16, 2024
@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Sep 16, 2024

Since openfoodfacts/openfoodfacts-dart#973 we have a Product.product_type field that we have to populate manually - the server is not ready yet.

  • When we scan a barcode, we have to search for it in all 4 servers.
  • If we find the product, we have to set its product_type before storing it to the local database.
  • When we edit the product, we need to log in to the related server, and to send the data to it.
  • When we refresh products, we have to download their data from the related server

Following are the methods we currently use in Smoothie, that need to be able to switch servers when needed:

  • read-only
    • getOrderedNutrientsJsonString
  • read-only, single product
    • getProductString
    • getProductV3
    • extractPackaging
    • extractIngredients
  • read-only, multi product
    • searchProducts
  • user related
    • resetPassword
    • register
    • login2
    • USER_NAME_MAX_LENGTH
  • write single product
    • temporarySaveProductV3
    • saveProduct
    • setProductImageAngle
    • setProductImageCrop
    • addProductImage
    • unselectProductImage

@monsieurtanuki
Copy link
Contributor

Looking for toothpaste this morning:

food beauty
Screenshot_1727425691 Screenshot_1727425459
pet food product
Screenshot_1727425464 Screenshot_1727425483

@teolemon
Copy link
Member Author

@stephanegigandet a clue to the ongoing situation with search: Hash Ecoscore

@stephanegigandet
Copy link
Contributor

@stephanegigandet a clue to the ongoing situation with search: Hash Ecoscore

I think that was solved, have you seen it recently?

@monsieurtanuki
Copy link
Contributor

@stephanegigandet Still experiencing an issue in .dev for beauty, but not the HASH issue for beauty in .org:

.dev .org
Image Image

@stephanegigandet
Copy link
Contributor

@monsieurtanuki on .dev we only have openfoodfacts.dev, we don't have openbeautyfacts.dev etc.

@monsieurtanuki
Copy link
Contributor

@stephanegigandet Then to answer your question: we don't seem to experience the HASH error anymore in .org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧴 Open Beauty Facts Please see this proposal: https://github.com/openfoodfacts/smooth-app/discussions/1378 🐾 Open Pet Food Facts 📸 Open Products Facts 🔎 Search
Projects
Status: Done
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants