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: #2362 history not refreshing #2393

Merged

Conversation

cli1005
Copy link
Contributor

@cli1005 cli1005 commented Jun 27, 2022

What

Screenshot

RPReplay-Final1656320604.mov
RPReplay-Final1656320080.MP4

Fixes bug(s)

@cli1005 cli1005 requested a review from a team as a code owner June 27, 2022 09:16
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2022

Codecov Report

Merging #2393 (4e47748) into develop (2ea0da3) will decrease coverage by 1.34%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           develop   #2393      +/-   ##
==========================================
- Coverage     8.86%   7.52%   -1.35%     
==========================================
  Files          161     204      +43     
  Lines         6623    9770    +3147     
==========================================
+ Hits           587     735     +148     
- Misses        6036    9035    +2999     
Impacted Files Coverage Δ
...kages/smooth_app/lib/widgets/attribute_button.dart 0.00% <0.00%> (-92.00%) ⬇️
...s/smooth_app/lib/data_models/user_preferences.dart 8.73% <0.00%> (-23.57%) ⬇️
packages/smooth_app/lib/themes/smooth_theme.dart 60.00% <0.00%> (-22.98%) ⬇️
...p/lib/generic_lib/dialogs/smooth_alert_dialog.dart 15.29% <0.00%> (-18.92%) ⬇️
...mooth_app/lib/data_models/product_preferences.dart 24.65% <0.00%> (-6.78%) ⬇️
packages/smooth_app/lib/main.dart 14.40% <0.00%> (-3.49%) ⬇️
.../smooth_app/lib/pages/onboarding/welcome_page.dart 0.00% <0.00%> (-3.13%) ⬇️
.../smooth_app/lib/pages/onboarding/scan_example.dart 0.00% <0.00%> (-2.28%) ⬇️
...p/lib/pages/onboarding/consent_analytics_page.dart 0.00% <0.00%> (-1.57%) ⬇️
...smooth_app/lib/pages/product/new_product_page.dart 0.00% <0.00%> (-0.88%) ⬇️
... and 204 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4aa3671...4e47748. Read the comment docs.

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Hi again @cli1005!
Looks like it solves the issue.

Not a big fan of the added parameter needNotify. I would just call daoProductList.localDatabase.notifyListeners() after _daoProductList.push(_history, _latestFoundBarcode!);, and not use that extra parameter.

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Thank you @cli1005!
In general, I would say that in Smoothie we're not good with providers and notifications. That would require a specific issue about who we should notify and when, but that's another story.

@cli1005
Copy link
Contributor Author

cli1005 commented Jun 29, 2022

A update on openfoodfacts broke the Pre-submits test check, KnowledgePanelElementType has a new type ACTION? should we do something for adapting?

@monsieurtanuki
Copy link
Contributor

A update on openfoodfacts broke the Pre-submits test check, KnowledgePanelElementType has a new type ACTION? should we do something for adapting?

@cli1005 Sure we should do something:

  1. in Smoothie we cannot expect to be always 100% in phase with the server, and therefore we should be more relaxed if we don't know a new KP element. In those cases, no crash but just send a message to Logs and we'll get notifications from sentry and others
  2. yesterday I merged feat: #495 - new "action" element for knowledge panels openfoodfacts-dart#496 in new off-dart 1.20.0, and you should use it

@monsieurtanuki
Copy link
Contributor

@cli1005 I'm working on the fix.
When you coded everything was fine.
The other PRs where the tests were not re-run are fine.
If I pull the latest version of the app, everything is fine, even after a flutter pub get.
The problem is that the test tool probably runs an additional flutter pub upgrade that "forces" him to take into account off-dart 1.20.0 and the new element. I don't know what we should do about it, in general: just be very careful for every new off-dart release and immediately check if Smoothie is fine?

@M123-dev
Copy link
Member

M123-dev commented Jun 30, 2022

Issue for long time fix

@teolemon
Copy link
Member

develop has been fixed and merged, so merging this one.
Thanks @cli1005

@teolemon teolemon merged commit 061fa6e into openfoodfacts:develop Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

History not refreshing when scanning a new product
5 participants