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: Let's try to fix a crash with a null variable in the CameraScannerPageState #4713

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Oct 16, 2023

Hi everyone,

Following #4696 and with my tests during the POC, it seems that in release mode and the first time the screen is displayed, the size of the screen is set to zero. We simply have to wait a few frames.

I'm not sure if it will fix #4696, but now the algorithm retries to fetch the value + add a try/catch.

@g123k g123k self-assigned this Oct 16, 2023
@g123k g123k requested a review from a team as a code owner October 16, 2023 08:38
@github-actions github-actions bot added the 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… label Oct 16, 2023
@sweep-ai
Copy link

sweep-ai bot commented Oct 16, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2023

Codecov Report

Merging #4713 (1c18faa) into develop (34f3364) will decrease coverage by 0.01%.
Report is 1 commits behind head on develop.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           develop   #4713      +/-   ##
==========================================
- Coverage     9.90%   9.90%   -0.01%     
==========================================
  Files          310     310              
  Lines        15807   15813       +6     
==========================================
  Hits          1566    1566              
- Misses       14241   14247       +6     
Files Coverage Δ
...es/smooth_app/lib/pages/scan/camera_scan_page.dart 1.88% <0.00%> (-0.25%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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 @g123k!
I would have removed altogether the concept of _headerHeight, but I'm notoriously not as pixel-precise as you are.
Not sure either that the PR will solve the initial issue (it looked like a matter of null rather than 0), but your try/catch will probably be helpful.

@teolemon teolemon merged commit f87e257 into openfoodfacts:develop Oct 25, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Projects
None yet
4 participants