-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[camera][google_fonts] Fixes future warning for awaiting Future returns in async bodies inside try blocks
#11009
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
base: main
Are you sure you want to change the base?
Conversation
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
|
|
| @@ -266,8 +270,8 @@ | |||
| ## 6.3.1 | |||
|
|
|||
| - Transfers the package source from | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes to past release's changelog entries necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did by mistake. Sorry. I'll undo them. Thanks for noticing!
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