openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
787 stars 271 forks source link

We need to sort out the refresh scenario. #4941

Open monsieurtanuki opened 8 months ago

monsieurtanuki commented 8 months ago
          We need to sort out the refresh scenario. 
  1. There's been the language change issue for a while (mostly happens to me when I demo the app) #1651
  2. I'm not clear if we refresh systematically on opening the full product page (I believe we should, especially as the structure of the knowledge panel evolves)
  3. That is going to be all the more pressing that we're going to have the new Nutri-Score soon (March/April?). https://www.francetvinfo.fr/replay-radio/le-billet-vert/alimentation-les-regles-du-nutri-score-evoluent_6246153.html
    • Nutri-Score: We'll need a team brainstorm to find how we want to showcase the change in the app.
    • Do nothing
    • Refresh (silently or not) all products from all installs in a way that is compatible with the server not being overwhelmed ?
    • Refresh (silently or not) on opening the product ?
    • Refresh manually with a promotion like: "The new Nutri-Score formula is here. Tap to refresh the score for all products you have ever scanned."

Originally posted by @teolemon in https://github.com/openfoodfacts/smooth-app/issues/4940#issuecomment-1873412507

monsieurtanuki commented 8 months ago

@teolemon They are indeed related to #4940, but all those questions deserve at least one specific issue.

monsieurtanuki commented 8 months ago

@teolemon Definitely related to #4717, where my review said that if we want to do it in bulk, we need background tasks.

What you've added in your comment is:

All local products should be refreshed. Possible pitfalls:

  1. bulk refresh could crash the server. Possible solution: slow bulk refresh (e.g. 100 products download, then we wait 10 minutes before the next 100 product download)
  2. some products are more interesting, but the bulk refresh (especially if slow) may treat them at the end. Possible solution: in parallel, a specific refresh for all the products in (recent) history, ordered by descending last access time

Specific products should definitely be refreshed first. When we look at a product list, we already see the individual nutriscores. Should we refresh the product instantly, even if the product page is not open? How often?

Other points to consider:

teolemon commented 8 months ago