[camera][google_fonts] Fixes future warning for awaiting Future returns in async bodies inside try blocks#11009
[camera][google_fonts] Fixes future warning for awaiting Future returns in async bodies inside try blocks#11009FMorschel wants to merge 4 commits intoflutter:mainfrom
awaiting Future returns in async bodies inside try blocks#11009Conversation
…s inside `try` blocks
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request adds the await keyword to Future-returning calls within try blocks in async functions across the camera and google_fonts packages. This ensures that exceptions from these asynchronous operations are caught by the surrounding try-catch blocks, which fixes a potential error handling issue. The changes are consistent across all modified files. The pull request description notes that these are bug fixes; based on the repository's contribution guidelines, it would be beneficial to also include corresponding updates to CHANGELOG.md, version bumps in pubspec.yaml, and tests to cover these fixes.
|
test-exempt: unblocks future analyzer update |
That's not the bar for our packages, the bar is as documented on the linked page:
This is changing production code's behavior, so by definition needs to be published to take effect. |
|
I see. I'm still not entirely sure whether Besides the example changes I've still edited:
|
|
|
This is merely an
analyzerchange to avoid the bug explained at:This will allow the development of a warning about these situations so we can avoid this bug in the future.
I'm not entirely sure about the version change. This is definitely not working as the author(s) expected (as described on the issue linked above), but I'm not sure how urgent this needs to be published, so I'll leave it up to the reviewers. Same about tests (which I'm not sure exactly where to add them) and CHANGELOGs.
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3