Skip to content

Enable unawaited_futures lint across the Flutter repository - #193125

Merged
auto-submit[bot] merged 7 commits into
flutter:masterfrom
victorsanni:enable-unawaited-futures
Sep 29, 2026
Merged

auto-submit[bot] merged 7 commits into
flutter:masterfrom
victorsanni:enable-unawaited-futures

Conversation

@victorsanni

@victorsanni victorsanni commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Enables the unawaited_futures lint rule in analysis_options_common.yaml across the Flutter repository.

Closes #168555

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 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.

Comment thread dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart Outdated
@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs f: scrolling Viewports, list views, slivers, etc. f: routes Navigator, Router, and related APIs. f: integration_test The flutter/packages/integration_test plugin team-web Owned by Web platform team labels Sep 21, 2026
@flutter-dashboard

Copy link
Copy Markdown

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.

@github-actions github-actions Bot removed a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs f: scrolling Viewports, list views, slivers, etc. f: routes Navigator, Router, and related APIs. f: integration_test The flutter/packages/integration_test plugin team-web Owned by Web platform team labels Sep 21, 2026
@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 21, 2026
@Renzo-Olivares
Renzo-Olivares self-requested a review September 22, 2026 22:58

@Renzo-Olivares Renzo-Olivares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread analysis_options_common.yaml
RickyvdBerg pushed a commit to avio-os/avio-flutter that referenced this pull request Sep 25, 2026
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 dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We're finally coming to an end!

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 28, 2026
Merged via the queue into flutter:master with commit 3475a9e Sep 29, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2026
@jtmcdole

Copy link
Copy Markdown
Member

This is breaking post submit for the engine.

DanTup pushed a commit to DanTup/flutter that referenced this pull request Sep 29, 2026
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.
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 29, 2026
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
@victorsanni
victorsanni deleted the enable-unawaited-futures branch October 1, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use @awaitNotRequired in Flutter SDK

4 participants