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

Automatic "download product" for products in error #2671

Closed
monsieurtanuki opened this issue Jul 28, 2022 · 0 comments · Fixed by #2673
Closed

Automatic "download product" for products in error #2671

monsieurtanuki opened this issue Jul 28, 2022 · 0 comments · Fixed by #2673
Assignees
Labels

Comments

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Jul 28, 2022

Problem

  • The most frequent sentry error we have is about products whose barcode is in the list but the product itself is not in the local database. I have no strong opinion on how this can happen, but it does happen.
  • We recently changed the way the lists are displayed (feat: #2396 - better memory management - load products only when needed #2609), which gives us more flexibility. Before, as we were building the whole list of products before displaying them, we just skipped the products that were not in the database (and send a sentry message). Now lists are barcode lists: we say "just display the product related to this barcode", and let the widget say "hey, I don't know this product" to the user.

Proposed solution

Additional context

  • When there's a problem with one product, there are probably other problematic products. In addition to the current issue, we could imagine a "fix the database" button. But that goes beyond the current issue.

Part of

@teolemon teolemon added the lists label Jul 28, 2022
@monsieurtanuki monsieurtanuki self-assigned this Jul 28, 2022
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Jul 28, 2022
…t in local database

Impacted files:
* `product_list_item_simple.dart`: refactored
* `product_model.dart`: now we try to download the product if for some unexpected reason it's not in the local database.
* `smooth_product_card_template.dart`: added parameters `barcode` and `error` for more flexibility.
@monsieurtanuki monsieurtanuki changed the title "download product" button for products in error Automatic "download product" ~~button~~ for products in error Jul 28, 2022
@monsieurtanuki monsieurtanuki changed the title Automatic "download product" ~~button~~ for products in error Automatic "download product" for products in error Jul 28, 2022
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Jul 28, 2022
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Jul 29, 2022
…ard"

Impacted files:
* `attribute_button.dart`: unrelated minor refactoring
* `design_constants.dart`: unrelated minor refactoring
* `onboarding_bottom_bar.dart`: unrelated minor refactoring
* `product_list_item_simple.dart`: added a "refresh product" button on "error card"; different card for "loading" and "downloading"
* `product_model.dart`: added a callable `download` method
* `smooth_product_card_template.dart`: added optional "action button"; refactored
monsieurtanuki added a commit that referenced this issue Aug 1, 2022
…tabase (#2673)

* product lists - downloads products when not in local database
* added "refresh product" button on "error card"

Impacted files:
* `attribute_button.dart`: unrelated minor refactoring
* `design_constants.dart`: unrelated minor refactoring
* `onboarding_bottom_bar.dart`: unrelated minor refactoring
* `product_list_item_simple.dart`: added a "refresh product" button on "error card"; different card for "loading" and "downloading"; refactored
* `product_model.dart`: now we try to download the product if for some unexpected reason it's not in the local database; added a callable `download` method
* `smooth_product_card_template.dart`: added parameters `barcode` and `error` for more flexibility; added optional "action button"; refactored
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants