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

fix: 4301 - new "up-to-date" provider for product list #4321

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • We already had an "up-to-date" provider for products, which gave an instant access to the latest version of the interesting (e.g. visible) products, like the latest server downloads with the local changes on top.
  • Now we implement an "up-to-date" provider for product lists, which gives an instant access to the barcode lists of each "interesting" product list.
  • That fixes New list picker scan session broken, when empty #4301: the product list page uses an product list up-to-date provider. More specifically, if we open the scan history product page, and then scan a barcode, the new barcode will be visible if we go back to the scan history product page.

Fixes bug(s)

Files

New files:

  • up_to_date_interest.dart: Management of the interest for a key.
  • up_to_date_product_list_mixin.dart: Provides the most up-to-date local product list data for a StatefulWidget.
  • up_to_date_product_list_provider.dart: Provider that reflects the latest barcode lists on ProductLists.

Impacted files:

  • dao_product_list.dart: made public method getKey; refreshes the provider
  • local_database.dart: added a new UpToDateProductListProvider
  • product_list_page.dart: now extends `UpToDateProductListMixin
  • up_to_date_product_provider.dart: refactored using a UpToDateInterest
  • user_preferences_account.dart: removed redundant access to product list page

New files:
* `up_to_date_interest.dart`: Management of the interest for a key.
* `up_to_date_product_list_mixin.dart`: Provides the most up-to-date local product list data for a StatefulWidget.
* `up_to_date_product_list_provider.dart`: Provider that reflects the latest barcode lists on ProductLists.

Impacted files:
* `dao_product_list.dart`: made public method `getKey`; refreshes the provider
* `local_database.dart`: added a new `UpToDateProductListProvider`
* `product_list_page.dart`: now extends `UpToDateProductListMixin
* `up_to_date_product_provider.dart`: refactored using a `UpToDateInterest`
* `user_preferences_account.dart`: removed redundant access to product list page
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2023

Codecov Report

Merging #4321 (e199713) into develop (1cd22a6) will decrease coverage by 0.26%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #4321      +/-   ##
===========================================
- Coverage    10.80%   10.54%   -0.26%     
===========================================
  Files          287      290       +3     
  Lines        14202    14251      +49     
===========================================
- Hits          1534     1503      -31     
- Misses       12668    12748      +80     
Impacted Files Coverage Δ
...mooth_app/lib/data_models/up_to_date_interest.dart 0.00% <0.00%> (ø)
...lib/data_models/up_to_date_product_list_mixin.dart 0.00% <0.00%> (ø)
.../data_models/up_to_date_product_list_provider.dart 0.00% <0.00%> (ø)
...p/lib/data_models/up_to_date_product_provider.dart 0.00% <0.00%> (ø)
...ages/smooth_app/lib/database/dao_product_list.dart 0.00% <0.00%> (-4.62%) ⬇️
...ckages/smooth_app/lib/database/local_database.dart 0.00% <0.00%> (ø)
...ib/pages/preferences/user_preferences_account.dart 62.87% <ø> (+0.57%) ⬆️
...pp/lib/pages/product/common/product_list_page.dart 0.00% <0.00%> (ø)

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Contributor

Copy link
Collaborator

@g123k g123k left a comment

Choose a reason for hiding this comment

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

LGTM to me, but I'm not against a review from @M123-dev

@monsieurtanuki monsieurtanuki merged commit d9e49df into openfoodfacts:develop Jul 16, 2023
@monsieurtanuki
Copy link
Contributor Author

Thank you @g123k for the review!

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

Successfully merging this pull request may close these issues.

New list picker scan session broken, when empty
3 participants