Repository navigation
Enable unawaited_futures lint across the Flutter repository - #193125
Conversation
There was a problem hiding this comment.
Code Review
This pull request enables the unawaited_futures linter rule in analysis_options_common.yaml and updates various files across the repository to comply with it by adding await, wrapping calls in unawaited(), or using ignore comments. However, in dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart, awaiting the nested windowRenderDuration profile inside the sceneBuildDuration callback incorrectly includes the asynchronous render time in the build duration metric, altering the benchmark's behavior. It is recommended to wrap the inner profile record in unawaited or un-nest the metrics to preserve the original measurement behavior.
|
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. |
Resolves the remaining `unawaited_futures` violations across
- `packages/flutter/lib/`,
- `packages/flutter_driver/`,
- `packages/integration_test/`,
- `dev/`, and
- non-frozen tests in
`packages/flutter/test/{animation,foundation,services,widgets}`
in preparation for enabling `unawaited_futures` repository-wide
(flutter#193125).
Call sites use `await`, `unawaited(...)`, or `// ignore:
unawaited_futures` (where stack trace line/column expectations must be
preserved).
Mostly Dart SDK functions are causing this. Missed when working on this
earlier.
Part of flutter#168555
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
dkwingsmt
left a comment
There was a problem hiding this comment.
LGTM. We're finally coming to an end!
|
This is breaking post submit for the engine. |
Resolves the remaining `unawaited_futures` lints in `engine/src/flutter/` after `unawaited_futures` was enabled in `analysis_options_common.yaml` (flutter#193125). Part of flutter#168555 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
flutter/flutter@c5a061b...55b8f88 2026-09-29 [email protected] [Android 17] Added Android 17 device to Firebase tests (flutter/flutter#193251) 2026-09-29 [email protected] [engine] Fix remaining `unawaited_futures` lints (flutter/flutter#193508) 2026-09-29 [email protected] shell: Rename first-frame tests AddFirstFrameCallback* (flutter/flutter#193418) 2026-09-28 [email protected] Enable `unawaited_futures` lint across the Flutter repository (flutter/flutter#193125) 2026-09-28 [email protected] Upgrade flutter/flutter to Roblectric 4.17 (flutter/flutter#193369) 2026-09-28 [email protected] [engine] Decode animation frames with alpha after an opaque first frame (flutter/flutter#193113) 2026-09-28 [email protected] Allow macOS tests to use macOS 15 or 26 (flutter/flutter#193317) 2026-09-28 [email protected] Cleanup DDC SDK build targets (flutter/flutter#193193) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Enables the
unawaited_futureslint rule inanalysis_options_common.yamlacross the Flutter repository.Closes #168555
Pre-launch Checklist
///).