* fix: 5933 - less greedy language refresh
Impacted files:
* `background_task_language_refresh.dart`: now we restart only the dedicated product type queue instead of all
* `operation_type.dart`: new `getProductType` method; minor refactoring
* `offline_tasks_page.dart`: display the product type for tasks, when available
* Optimized database query
* Typo fix
New file:
* `background_task_queue.dart`: Queues for Background Tasks.
Impacted files:
* `background_task.dart`: now we add tasks to a specific queue
* `background_task_add_other_price.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_add_price.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_badge.dart`: minor refactoring
* `background_task_crop.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_details.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_download_products.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_full_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_hunger_games.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_image.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_language_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_manager.dart`: now using new class `BackgroundTaskQueue` in order to use multiple queues
* `background_task_offline.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_refresh_later.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_top_barcodes.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_unselect.dart`: assigned to `BackgroundTaskQueue.fast`
* `dao_string_list.dart`: added 2 queues
* `local_database.dart`: now running all queues
* `local_database_mock.dart`: minor refactoring
* `offline_tasks_page.dart`: now taking queues into account
* `up_to_date_mixin.dart`: now running all queues
* `user_preferences_page.dart`: now running all queues
New file:
* `work_type.dart`: Type of long download work for some background tasks.
Impacted files:
* `background_task.dart`: removed the default `uriProductHelper` getter
* `background_task_barcode.dart`: added a `uriProductHelper` getter that depends on the `productType`
* `background_task_download_products.dart`: refactored the access to product type
* `background_task_full_refresh.dart`: split by product type
* `background_task_language_refresh.dart`: split by product type
* `background_task_offline.dart`: refactored the access to product type
* `background_task_progressing.dart`: added the `productType` parameter; moved code to new `WorkType` class
* `background_task_top_barcodes.dart`: refactored the access to product type
* `dao_product.dart`: new methods `getProductTypes` and `splitAllProducts`; refactored with product type
* `lazy_counter.dart`: explicitly counting the "food" products
* `newsfeed_provider.dart`: explicitly getting the news from "food"
* `offline_data_page.dart`: now displaying "download top N products" buttons for each product type; stats for each product type
* `offline_tasks_page.dart`: enhanced "work text" algo, now depending on product type
* `operation_type.dart`: enhanced "key" algo, now depending on product type
* `ordered_nutrients_cache.dart`: explicitly using the "food" nutrients
* `product_list_page.dart`: now reloading products from their server
* `product_list_popup_items.dart`: now linking to the first server with products
* `product_query.dart`: made product type a mandatory parameter
* `product_refresher.dart`: added mandatory parameter product type
* `random_questions_query.dart`: explicitly ask for "food" robotoff products
* `temp_product_list_share_helper.dart`: added mandatory parameter product type
* `user_preferences_dev_debug_info.dart`: added explicit use of "food" data
* fix: 5693 - able to run tasks without minimum duration wait
Impacted files:
* `background_task_manager.dart`: made it possible to force an immediate run if possible
* `offline_tasks_page.dart`: force an immediate run if possible when clicking on the refresh button
* Added a call to BackgroundTaskManager.run related to prices
* Minor fix
* Wtf tests
* Ugly fix for mocking hive
New file:
* `background_task_language_refresh.dart`: Background task about downloading products to translate.
Impacted files:
* `background_task_manager.dart`: minor refactoring
* `dao_product.dart`: new method `getTopProductsToTranslate`
* `local_database.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring
* `operation_type.dart`: new operation type `languageRefresh`
* `product_refresher.dart`: minor refactoring
* `up_to_date_mixin.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
* `user_preferences_language_selector.dart`: now calling new task `BackgroundTaskLanguageRefresh` when changing language
Impacted files:
* `app_en.arb`: added a label for "server timeout"
* `background_task_top_barcodes.dart`: now explicitly using page number parameter, as server data is not 100% reliable
* `dao_work_barcode.dart`: minor refactoring
* `offline_tasks_page.dart`: detected a typical "server timeout" error message and replaced it with a more user-friendly message
* fix: 4066 - top n product download split in smaller robust parts
New files:
* `background_offline_barcodes.dart`: Background subtask about pre-downloading top n barcodes.
* `background_offline_products.dart`: Background subtask about downloading products.
* `dao_work_barcode.dart`: Work table that contains barcodes.
Impacted files:
* `background_task_offline.dart`: now we clean the new `DaoWorkBarcode` and we just call the new `BackgroundtaskOfflineBarcodes`
* `local_database.dart`: upgraded to version 3, with the new `DaoWorkBarcode`.
* `operation_type.dart: added the new 2 background tasks.
TODO
* `backgrount_task_manager.dart`: make it possible to actually chain tasks with immediate execution
* Penultimate step before un-drafting
New files:
* `background_task_paged.dart`: Abstract background task with paged actions.
* `background_task_progressing.dart`: Abstract background task with work in progress actions.
Impacted files:
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_hunger_games.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_refresh_later.dart`: minor refactoring
* `background_task_unselect.dart`: minor refactoring
* `background_task_upload.dart`: minor refactoring
* `dao_work_barcode.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `local_database.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring; displays progress percentage
* `operation_type.dart`: moved file; minor refactoring for progress percentage
* `product_image_gallery_view.dart`: minor refactoring
* `up_to_date_changes.dart`: minor refactoring
Later:
* `background_task.dart`
* `background_task_download_products.dart`
* `background_task_full_refresh.dart`
* `background_task_manager.dart`
* `background_task_offline.dart`
* `background_task_top_barcodes.dart`
* `offline_data_page.dart`
* Final commit for main features.
Impacted files:
* `app_en.arb`: added a label for topN download with parameter
* `background_task.dart`: added a bool getter for immediate exec of the next task; minor refactoring
* `background_task_download_products.dart`: now as a _progressing_ background task, reused for top N, with KP and without KP
* `background_task_full_refresh.dart`: now as a _paged_ background task, that opens two progressing download tasks (one with KP, one without KP)
* `background_task_manager.dart`: now working as singleton; added a special case for immediate exec of the next task
* `background_task_offline.dart`: now as a _progressing_ background task
* `background_task_top_barcodes.dart`: now as a _progressing_ background task
* `dao_work_barcodes.dart`: fixed the bulk insert and delete for more than 1K products (actually, 1K SQL parameters)
* `offline_data_page.dart`: now using topN and pageSize parameters
* `offline_tasks_page.dart`: added a "work" label for the tasks
* `operation_type.dart`: now embeds the "work" in the task id
* Update packages/smooth_app/lib/background/background_task_download_products.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_download_products.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_progressing.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_progressing.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* fix: 4066 - localization
---------
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Migration to Flutter 3.10
* Bump Flutter version on actions
* GitHub Actions: use channel instead of a fixed version of Flutter
* Add a missing argument due to the upgrade to Flutter 3.10
* Regenerate goldens
---------
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
New files:
* `background_task_unselect.dart`: Background task about unselecting a product image.
* `edit_image_button.dart`: Standard text button for the "edit image" pages. Used to be in `NewCropPage` as `_OutlinedButton`.
Impacted files:
* `abstract_background_task.dart`: added new "unselect" task
* `app_en.arb`: added a label for the "unselect image" button
* `background_task_manager.dart`: unrelated minor fix
* `new_crop_page.dart`: moved `_OutlinedButton` code to new file `edit_image_button.dart`
* `offline_tasks_page.dart`: moved code to `OperationType`
* `operation_type.dart`: new `enum` for "unselect"; new method `getLabel`
* `product_image_viewer.dart`: changed the layout in order to add the "unselect image" button
* `up_to_date_changes.dart`: included the new "unselect" type to product changes
Impacted files:
* `background_task_badge.dart`: slightly modified the position as we're not using it in the same conditions
* `offline_tasks_page.dart`: better wording for "refresh later"
* `page_manager.dart`: remove the badge on "profile" icon about background tasks
* `Podfile.lock`: wtf
* `user_preferences_dev_mode.dart`: put back the access to the pending background task page
* `user_preferences_page.dart`: removed the access to the pending background task page
* fix: 3570 - background task order is now respected
Impacted files:
* `app_en.arb`: added a label for the "stop this task ASAP?" question and the corresponding task label
* `background_task_manager.dart`: fixed a bug where the task list was refreshed inappropriately; now it's possible to cancel a task; refactored
* `offline_tasks_page.dart`: now when you click on a task, you can stop it ASAP (for the record that does not mean immediately)
* fix: 3570 - better task cleaning when successful or dismissed
Impacted files:
* `abstract_background_task.dart`: added a "success?" parameter to `postExecute`
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: made the distinction between a simple garbage collecting and a successful task run
* `background_task_manager.dart`: now we clean deeper when we remove a task
* `background_task_refresh_later.dart`: minor refactoring
* feat: 3565 - badge on bottom bar about background tasks and access to list
Impacted files:
* `app_en.arb`: added 9 labels related to background tasks
* `background_task_manager.dart`: added an error/status for each task; removed the concept of "blocked" task manager
* `offline_tasks_page.dart`: localized and added error labels
* `page_manager.dart`: added a badge on bottom bar about pending background tasks
* `pubspec.lock`: wtf
* `pubspec.yaml`: added a dependency to `badges`
* `user_preferences_dev_mode.dart`: removed the access to the pending background task page
* `user_preferences_page.dart`: added a direct access to the pending background task page
* feat: 3565 - badge on bottom bar about background tasks and access to list
New file:
* `background_task_badge.dart`: Badge about pending background tasks.
Impacted files:
* `app_en.arb`: added 1 label about subtitle, edited the label about title
* `page_manager.dart`: now using new class `BackgroundTaskBadge`
* `user_preferences_page.dart`: added a subtitle and a badge for background tasks
* feat: 3565 - refreshed goldens test
* feat: 3565 - golden tests
Impacted files:
* `background_task_badge.dart`: refactored
* `background_task_manager.dart`: refactored
* `dao_string_list.dart`: added comments
* `local_database.dart`: added a method to be mocked
* `local_database_mock.dart`: overrode a method
* `offline_tasks_page.dart`: refactored
* `user_preferences_page-dark.png`: goldens
* `user_preferences_page-light.png`: goldens
* `user_preferences_page_test.dart`: added a reference to `LocalDatabase`
* feat: 3565 - golden tests
Impacted files:
* `background_task_badge.dart`: refactored
* `background_task_manager.dart`: refactored
* `dao_string_list.dart`: added comments
* `local_database.dart`: added a method to be mocked
* `local_database_mock.dart`: overrode a method
* `offline_tasks_page.dart`: refactored
* `user_preferences_page-dark.png`: goldens
* `user_preferences_page-light.png`: goldens
* `user_preferences_page_test.dart`: added a reference to `LocalDatabase`
Deleted file:
* `background_task_helper.dart`
New files:
* `background_task_manager.dart`: Management of background tasks: single thread, block, restart, display.
* `dao_instant_string.dart`: Where we store strings that need INSTANT access (= not lazy, no await).
Impacted fles:
* `abstract_background_task.dart`: refactored
* `background_task_details.dart`: refactored around the changes in `AbstractBackgroundTask`
* `background_task_image.dart`: refactored around the changes in `AbstractBackgroundTask`
* `dao_string_list.dart`: refactoring around now managing several lists; removed unnecessary `await` for a non-lazy dao
* `local_database.dart`: added the new class `DaoInstantString`; relaunch the background task manager at every refresh
* `main.dart`: minor refactoring
* `new_crop_page.dart`: unrelated bug fix
* `offline_tasks_page.dart`: refactored around the new `BackgroundTaskManager`
* `operation_type.dart`: added helper methods
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_viewer.dart`: unrelated bug fix - the product was not refreshed, and so wasn't the image even after a successful download
* `pubspec.lock`: wtf
* `pubspec.yaml`: removed `flutter_task_manager`
* `search_history_view.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `search_page.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `up_to_date_changes.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
* work manager used for bg schedule
* removed swith case
* remove unwanted contrains and randomize the taskid
as image.others might fail
* added translations
* new product image upload working
* removed debug for work manager
* delete photo when uploaded
* use await keywords while initializing
* refactor the code
* fix show image after queed
* serialize and deserialze input data seperately
* add an instant product in the loacl db to
let the user not confuse
* added smooth random class
* use smooth random to generate 8 digits
* remove unneccesary await
* update the local db with a product if not yet
uploaded
* update local databse after sucessful
update into server
* don't refresh automatically after upload queed
* supply language code to work manager
* import app localizations
* small refactoring
* refactor the code for work manager
* iOS Config for WorkManager
* formatting
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* small fix
* add swith case to the workmanager
* efficient switch case
* Update packages/smooth_app/lib/l10n/app_en.arb
Suggested by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* minor fix
* Basic Input details add are now run in background
* basic details are now updated immediatly
even without internet
* nutrient edit task are now background
and also conflict when recheduling task is managed
* menu screen for background tasks and
nutrition edits are now backgrounded
* button for retry now works in the bg tasks screen
* formatting
* genaralised function for non image tasks
* should retry set default to false
* better mechanism for retries and refactor
* refactor and consts duration of 3s for snackbars
* now language country and user are properly dropped
* Update packages/smooth_app/ios/Runner/Info.plist
* Update packages/smooth_app/ios/Runner/AppDelegate.swift
* Error messages fixed
* custom workmanager dependencies added
* migrated basic detail task from work manager to
taskmanager
* chanages to do the product edit changes in bg
* dart format
* cleaned the function calls when doing bg task
* dao_task edited
* unnecessary methods removed
* use int as id instead of string
* added comments and made fields final
* used const variable instead of hardcoded ones
* get pending tasks from taskManager class
* refactor
* handled exceptions
* string instead of int
* remove unused plugin
* removed unnessary files
* update to localdatabase working without islotes
* suggestions left as comments on PR
* deleted unncessary Random class
* doc added
* Remove WorkManager iOS code
* reset publock
* reset publock
* remove harcoded color
* used duration constant class instead of harcoded
* make methods to generate taskId
* dart frmt
* changes as per the code review
* string buffer , var documentation and rename
* error fix
* refactor and spelling corrections
* /// instead of //
* dart ff formater
* more refactorings
* Update background_task_helper.dart
* dart ff fix
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
Co-authored-by: Edouard Marquez <g123k@users.noreply.github.com>
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>