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: #1697 - checking hasError instead of hasData in FutureBuilder #1705

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted file:

  • loading_dialog.dart: checking hasError instead of hasData - hasData is not reliable as data can be void or null.

What

  • Interesting case!
  • Here we use LoadingDialog.run<void>. Therefore if we test snapshot.hasData, we'll always get false (as void is not really a data).
  • When the snapshot is "done", it's either hasError or successful.
  • This PR is just about moving the tests order.
  • The app does not look good a few pages after, but that's another story.

Fixes bug(s)

…ureBuilder

Impacted file:
* `loading_dialog.dart`: checking hasError instead of hasData - hasData is not reliable as data can be void or null.
@monsieurtanuki monsieurtanuki merged commit 20a9da0 into openfoodfacts:develop Apr 29, 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.

The load product from internet loops infinitely, on good networks, during onboarding
2 participants