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

feat: #796 - added a "refresh products" button to history page #1192

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted file:

  • product_list_page.dart: added a "refresh products" button; refactored

Screenshot

@teolemon I 'm sure you won't like the UI, but at least the feature is there. Note the additional refresh icon on the app bar:
Simulator Screen Shot - iPhone 8 Plus - 2022-03-10 at 14 14 34

Part of

Additional thoughts

It's not that easy to test that feature, as there's no real product timestamp.

…y page

Impacted file:
* `product_list_page.dart`: added a "refresh products" button; refactored
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner March 10, 2022 13:17
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Code looks good, but we have to keep one thing in mind, what happens when refreshing the history list when you are a long time User with possibly thousands of products.

We should handle them one by one. So update the first, put the first into storage, update a progress indicator and then go to the next one

@monsieurtanuki
Copy link
Contributor Author

Code looks good, but we have to keep one thing in mind, what happens when refreshing the history list when you are a long time User with possibly thousands of products.

You're right, but we will have the same problem displaying the list, which means loading 1000s of products in memory.
Then other performance issues like "is it better to fetch 1000 products in one query" / "100 products each in 10 queries" / "10 products each in 100 queries"? Let alone the fact that for that query we use a URL that concatenates the barcodes: we may reach the limits very soon (is that 1024 characters?).
All those questions could be dealt with in a specific "performance vs. number of products" issue.

@monsieurtanuki
Copy link
Contributor Author

@M123-dev Besides, I don't think it makes sense to keep 1000s of products in the history.
Thank you for the review btw ;)

@monsieurtanuki monsieurtanuki merged commit a452bff into openfoodfacts:develop Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants