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

bug/#628 - special "internet error" case for scan carousel product card #630

Merged
merged 2 commits into from
Oct 26, 2021

Conversation

monsieurtanuki
Copy link
Contributor

New file:

  • smooth_product_card_error.dart: Product Card when an exception is caught

Impacted files:

  • continuous_scan_model.dart: new value ScannedProductState.ERROR, used when an exception is caught during API call
  • smooth_product_carousel.dart: handling the ScannedProductState.ERROR case

Currently this is what an internet error looks like:
Screenshot_2021-10-21-12-28-02
I won't get the Nobel Prize for Design with that, but it's still better than a misleading CircularProgressIndicator.

…el product card

New file:
* `smooth_product_card_error.dart`: Product Card when an exception is caught

Impacted files:
* `continuous_scan_model.dart`: new value `ScannedProductState.ERROR`, used when an exception is caught during API call
* `smooth_product_carousel.dart`: handling the `ScannedProductState.ERROR` case
@teolemon
Copy link
Member

Can we perhaps add something like "Impossible to fetch information about this product due to a network error."

@monsieurtanuki
Copy link
Contributor Author

@teolemon That would look like that:
Screenshot_2021-10-23-18-57-15
You're right, it's better with an explicit message.

In addition to that, I had problems with the scan, and decided to type in the barcode.
There's a similar issue that I have to deal with too, because again there's an endless progress indicator as the exception is not caught:
Screenshot_2021-10-23-18-54-39

… over internet errors

New file:
* `fetched_product.dart`: combo of Product and its fetch status

Impacted files:
* `app_en.arb`: added translations for "internet error" and "canceled by user"
* `barcode_product_query.dart`: now using `FetchedProduct` instead of `Product`
* `choose_page.dart`: now using `FetchedProduct` instead of `Product`
* `continuous_scan_model.dart`: now using `FetchedProduct` instead of `Product`
* `new_product_page.dart`: now using `FetchedProduct` instead of `Product`
* `product_dialog_helper.dart`: now using `FetchedProduct` instead of `Product`
* `product_page.dart`: now using `FetchedProduct` instead of `Product`
* `smooth_product_card_error.dart`: added an explicit message
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @monsieurtanuki LGTM

@monsieurtanuki monsieurtanuki linked an issue Oct 26, 2021 that may be closed by this pull request
@monsieurtanuki monsieurtanuki merged commit e33a46e into openfoodfacts:develop Oct 26, 2021
@monsieurtanuki
Copy link
Contributor Author

Thank you @M123-dev! I'm going to create a similar issue on off-dart, as dart is rather relaxed regarding exception management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fragile interface when scan API call throws exception
3 participants