-
-
Notifications
You must be signed in to change notification settings - Fork 287
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: 4066 - top 1K pre-download and full refresh as background tasks #4131
fix: 4066 - top 1K pre-download and full refresh as background tasks #4131
Conversation
Deleted file: * `products_preload_helper.dart` New files: * `background_task.dart`: Abstract background task. * `background_task_full_refresh.dart`: Background task about refreshing all the already downloaded products. * `background_task_offline.dart`: Background task about pre-downloading top n products for offline usage. Impacted files: * `background_task_barcode.dart` * `background_task_crop.dart`: refactored * `background_task_details.dart`: refactored * `background_task_hunger_games.dart`: refactored * `background_task_image.dart`: refactored * `background_task_manager.dart` * `background_task_refresh_later.dart`: refactored * `background_task_unselect.dart`: refactored * `background_task_upload.dart`: refactored * `offline_data_page.dart`: now using background task for offline and full refresh tasks * `offline_tasks_page.dart`: dealing with the "no barcode" case * `operation_type.dart`: added values `offline` and `fullRefresh`; added `processName` field; added a `BackgroundTask` constructor * `product_refresher.dart`: bug fix
Codecov Report
@@ Coverage Diff @@
## develop #4131 +/- ##
===========================================
+ Coverage 10.88% 10.92% +0.04%
===========================================
Files 273 275 +2
Lines 13568 13517 -51
===========================================
Hits 1477 1477
+ Misses 12091 12040 -51
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@stephanegigandet What do you prefer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small question, but otherwise LGTM
languageCode: ProductQuery.getLanguage().offTag, | ||
user: jsonEncode(ProductQuery.getUser().toJson()), | ||
country: ProductQuery.getCountry()!.offTag, | ||
stamp: ';fullRefresh', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By curiosity, why do you start it with ;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before that PR we always had a single barcode involved, which meant a stamp like $barcode;whatever
(useful to check if a stamp is related to a barcode).
As there are no single barcodes for full refresh or top 1k, I somehow kept the same kind of stamp but without barcode.
Could be improved, but good enough for the moment.
What
Screenshot
(just tell me which labels you would like and I will put them in the next commit).
Refresh database:
Top 1K download:
Part of
Files
Deleted file:
products_preload_helper.dart
New files:
background_task.dart
: Abstract background task.background_task_full_refresh.dart
: Background task about refreshing all the already downloaded products.background_task_offline.dart
: Background task about pre-downloading top n products for offline usage.Impacted files:
background_task_barcode.dart
background_task_crop.dart
: refactoredbackground_task_details.dart
: refactoredbackground_task_hunger_games.dart
: refactoredbackground_task_image.dart
: refactoredbackground_task_manager.dart
background_task_refresh_later.dart
: refactoredbackground_task_unselect.dart
: refactoredbackground_task_upload.dart
: refactoredoffline_data_page.dart
: now using background task for offline and full refresh tasksoffline_tasks_page.dart
: dealing with the "no barcode" caseoperation_type.dart
: added valuesoffline
andfullRefresh
; addedprocessName
field; added aBackgroundTask
constructorproduct_refresher.dart
: bug fix