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: Add history refreshing (fixes 3162) #3840

Merged

Conversation

naivekook
Copy link
Contributor

@naivekook naivekook commented Feb 20, 2021

Description

Added history refreshing via API call. Refactored screen a bit to split up the logic and ui and make the screen more easy to read. The PR is quite big, but I don't see possibility to break it in small parts, sorry for that.

Related issues

Fix #3162

Related PRs

none

Screenshots

https://drive.google.com/file/d/1G8M0R7RAYfsF1MNATzuwC0GFgm29B4vr/view?usp=sharing

@naivekook
Copy link
Contributor Author

@VaiTon @teolemon ptal

@teolemon teolemon requested a review from a team February 23, 2021 08:44
@teolemon teolemon added the history The use and exporting of history within the application label Feb 23, 2021
@teolemon teolemon changed the title [3162] Add history refreshing feat: Add history refreshing (fixes 3162) Feb 27, 2021
@VaiTon
Copy link
Member

VaiTon commented Feb 27, 2021

I'm really sorry @naivekook but we need to break this down as you're adding tree dependencies and possibly breaking a lot of code. Could we start from refactoring the old code and then adding the new deps and only then adding the new feature. I know it's a lot of work but this pr doesn't only add the feature.

@naivekook
Copy link
Contributor Author

naivekook commented Feb 27, 2021

Yeah it's ok, it was to be expected that my PR will be declined

I thought how I can split my PR in a few small PRs, but the problem is that my refactor requires to include these new libraries (by the way these libraries are very small and very stable and tested in production many times). To remove the new functionality from refactoring you just need to remove lines 43-71 from ScanHistoryViewModel.kt.

The reason why I made this PR is I just want to show and discuss how we can refactor our screen with view model approach (looking through the code looks like this approach is more easy to implement here). I believe that we have to improve the codebase and write some tests if the project wants to move forward, because, to be honest, my eyes bleeding sometimes looking to it and our latest news about "Bad behaviour" say the same thing.

I have an idea @VaiTon, what if we can hop on call in OFF weekly meeting on Thursday and I will follow you (or someone else) through my code to describe how it works and what I've done?

P.S. sorry if I sounds too linear or offensive, english is not my native, I appreciate the work you've been done guys, just want to make the project better :)

@VaiTon
Copy link
Member

VaiTon commented Mar 2, 2021

Yeah it's ok, it was to be expected that my PR will be declined

I thought how I can split my PR in a few small PRs, but the problem is that my refactor requires to include these new libraries (by the way these libraries are very small and very stable and tested in production many times). To remove the new functionality from refactoring you just need to remove lines 43-71 from ScanHistoryViewModel.kt.

The reason why I made this PR is I just want to show and discuss how we can refactor our screen with view model approach (looking through the code looks like this approach is more easy to implement here). I believe that we have to improve the codebase and write some tests if the project wants to move forward, because, to be honest, my eyes bleeding sometimes looking to it and our latest news about "Bad behaviour" say the same thing.

I have an idea @VaiTon, what if we can hop on call in OFF weekly meeting on Thursday and I will follow you (or someone else) through my code to describe how it works and what I've done?

P.S. sorry if I sounds too linear or offensive, english is not my native, I appreciate the work you've been done guys, just want to make the project better :)

You don't sound offensive at all don't worry! Let's coordinate on slack then

@naivekook naivekook force-pushed the feature/history-refresh-via-server branch from 78d2dbe to 865a790 Compare March 14, 2021 08:10
@VaiTon
Copy link
Member

VaiTon commented Mar 14, 2021

@naivekook rebase?

@naivekook
Copy link
Contributor Author

Yes just rebased

@naivekook naivekook force-pushed the feature/history-refresh-via-server branch from 865a790 to 17f2b8f Compare March 18, 2021 12:03
@naivekook
Copy link
Contributor Author

naivekook commented Mar 20, 2021

@VaiTon @teolemon any update about this PR?

@teolemon
Copy link
Member

small conflict resolution necessary

@naivekook naivekook force-pushed the feature/history-refresh-via-server branch from 17f2b8f to 66cf7a2 Compare March 24, 2021 18:13
@sonarcloud
Copy link

sonarcloud bot commented Mar 24, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@VaiTon
Copy link
Member

VaiTon commented Apr 1, 2021

@naivekook let's cook this in develop

@VaiTon VaiTon merged commit 4740512 into openfoodfacts:develop Apr 1, 2021
@naivekook
Copy link
Contributor Author

Sorry I didn't test it well after last rebasing

@naivekook naivekook deleted the feature/history-refresh-via-server branch April 1, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
history The use and exporting of history within the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to refresh the history (causes big Nutri-Score problem)
3 participants