-
-
Notifications
You must be signed in to change notification settings - Fork 280
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: 4663 - use the latest password for background tasks + refactoring #4869
fix: 4663 - use the latest password for background tasks + refactoring #4869
Conversation
Impacted files: * `background_task.dart`: use the latest password; now we compute user and country from that class, and language most of the time too * `background_task_barcode.dart`: removed user and country parameters; replaced language * `background_task_crop.dart`: removed user and country parameters; replaced language * `background_task_details.dart`: removed user, language and country parameters * `background_task_download_products.dart`: removed user, language and country parameters * `background_task_full_refresh.dart`: removed user, language and country parameters * `background_task_hunger_games.dart`: removed user, language and country parameters * `background_task_image.dart`: removed user and country parameters; replaced language * `background_task_offline.dart`: removed user, language and country parameters * `background_task_paged.dart`: removed user, language and country parameters * `background_task_progressing.dart`: removed user, language and country parameters * `background_task_refresh_later.dart`: removed user, language and country parameters * `background_task_top_barcodes.dart`: removed user, language and country parameters * `background_task_unselect.dart`: removed user, language and country parameters * `background_task_upload.dart`: removed user and country parameters; replaced language * `paged_to_be_completed_product_query.dart`: minor refactoring * `paged_user_product_query.dart`: minor refactoring
The approach with User A : New background task In that particular case, the background task won't use the latest password from User A. Such behavior would allow notifying the user when we have some incorrect password error and quickly fix all issues |
@g123k As stated in the description, this PR only solves one typical case (a user changes passwords). I don't think it would make much sense to devote time to the unlikely situations you're describing, at least before the more likely (but not frequent either) "user-changing-passwords" case is dealt with, in this PR. |
I'm going to open an issue with the additional use-cases raised by @g123k |
Please do. I imagine the priority would be low, unless it's common for several users to use the same device and to log in / out accordingly. |
Thank you @g123k for your review! |
What
ProductQuery.getCountry()
) and the same user ((ProductQuery.getUser()
) and most of the time the same language (ProductQuery.getLanguage()
) (except for image uploads that do have a specific language - "this is the FRONT image for DE")Part of
Impacted files
background_task.dart
: use the latest password; now we compute user and country from that class, and language most of the time toobackground_task_barcode.dart
: removed user and country parameters; replaced languagebackground_task_crop.dart
: removed user and country parameters; replaced languagebackground_task_details.dart
: removed user, language and country parametersbackground_task_download_products.dart
: removed user, language and country parametersbackground_task_full_refresh.dart
: removed user, language and country parametersbackground_task_hunger_games.dart
: removed user, language and country parametersbackground_task_image.dart
: removed user and country parameters; replaced languagebackground_task_offline.dart
: removed user, language and country parametersbackground_task_paged.dart
: removed user, language and country parametersbackground_task_progressing.dart
: removed user, language and country parametersbackground_task_refresh_later.dart
: removed user, language and country parametersbackground_task_top_barcodes.dart
: removed user, language and country parametersbackground_task_unselect.dart
: removed user, language and country parametersbackground_task_upload.dart
: removed user and country parameters; replaced language