Skip to content

Add await or ignore lint to invokeMethod callsites#182870

Merged
auto-submit[bot] merged 28 commits into
flutter:masterfrom
victorsanni:invokeMethod-awaits
Apr 8, 2026
Merged

Add await or ignore lint to invokeMethod callsites#182870
auto-submit[bot] merged 28 commits into
flutter:masterfrom
victorsanni:invokeMethod-awaits

Conversation

@victorsanni

@victorsanni victorsanni commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Part of #181513

@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. labels Feb 25, 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 addresses unawaited_futures lint warnings across the codebase by either adding await to invokeMethod calls or ignoring the lint where await cannot be used without changing method signatures. The changes are mostly correct and improve code quality.

However, I've found a couple of issues:

  • In packages/flutter/test/services/platform_channel_test.dart, await has been added incorrectly within expect calls that test for exceptions. This will cause the tests to fail.
  • In packages/flutter/lib/src/services/undo_manager.dart, a private method was made async, which is good, but this introduces a new unawaited_futures warning at its call site in a public method. This change is incomplete.

I've left specific comments with suggestions on how to fix these issues. The rest of the changes look good.

Comment thread packages/flutter/test/services/platform_channel_test.dart Outdated
Comment thread packages/flutter/test/services/platform_channel_test.dart Outdated
Comment thread packages/flutter/lib/src/services/undo_manager.dart Outdated
Comment thread dev/integration_tests/android_views/lib/motion_events_page.dart Outdated
Comment thread packages/flutter/lib/src/services/live_text.dart
Comment thread packages/flutter/lib/src/services/system_chrome.dart Outdated
Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_menu_bar.dart Outdated

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

All instances of unawaited future in production code should be reported to FlutterError with a .catchError instead.

Comment thread packages/flutter/lib/src/services/live_text.dart
Comment thread packages/flutter/lib/src/services/system_chrome.dart Outdated
Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/services/undo_manager.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_menu_bar.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
Comment thread packages/flutter/test/services/platform_channel_test.dart Outdated
Comment thread packages/flutter/lib/src/rendering/binding.dart
Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/services/undo_manager.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
@victorsanni victorsanni requested a review from dkwingsmt March 6, 2026 22:03

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

Mostly OK. There's one place remaining.

Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
@victorsanni victorsanni requested a review from dkwingsmt March 9, 2026 19:03
@victorsanni victorsanni added the CICD Run CI/CD label Mar 24, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 24, 2026
@victorsanni victorsanni added the CICD Run CI/CD label Mar 24, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 24, 2026
@victorsanni victorsanni added the CICD Run CI/CD label Mar 24, 2026
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
Comment thread packages/flutter/lib/src/widgets/platform_view.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 8, 2026
@victorsanni victorsanni requested a review from dkwingsmt April 8, 2026 17:49
@victorsanni victorsanni added the CICD Run CI/CD label Apr 8, 2026

@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

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 8, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 8, 2026
Merged via the queue into flutter:master with commit 8bdaa65 Apr 8, 2026
162 of 163 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 8, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 9, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 9, 2026
flutter/flutter@05e0ae0...81c87ea

2026-04-09 [email protected] Remove last material dependency from cupertino tests (flutter/flutter#184781)
2026-04-09 [email protected] Roll Skia from 7c46cb639dba to 4d0f5389e131 (7 revisions) (flutter/flutter#184812)
2026-04-09 [email protected] Make `windowing_test` follow repo analyzer rules (flutter/flutter#184752)
2026-04-09 [email protected] Improve documentation of `frictionFactor` function (flutter/flutter#184509)
2026-04-09 [email protected] Roll Skia from d2b0bd12576a to 7c46cb639dba (1 revision) (flutter/flutter#184796)
2026-04-09 [email protected] Roll Fuchsia GN SDK from JLBh4Z9PKsjIJcqDU... to SEfYx3xgueX3aFAY3... (flutter/flutter#184797)
2026-04-09 [email protected] Fixed freeze flow (flutter/flutter#184793)
2026-04-09 [email protected] Roll pub packages (flutter/flutter#184795)
2026-04-09 [email protected] Roll Skia from e9ed4fc9f154 to d2b0bd12576a (36 revisions) (flutter/flutter#184791)
2026-04-08 [email protected] [Android] Allow sensitive content to gracefully fail when unregistering host before registering (flutter/flutter#184789)
2026-04-08 [email protected] Refactor: remove material from autocomplete_test, scrollable_restoration_test, semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test (flutter/flutter#184615)
2026-04-08 [email protected] Warn about the use of TestSemantics (flutter/flutter#184369)
2026-04-08 [email protected] Change freeze flow to pull_request_target (flutter/flutter#184785)
2026-04-08 [email protected] Update to the beta dart version for 3.44 branch cut.  (flutter/flutter#184770)
2026-04-08 [email protected] [Dot shorthands] Migrate examples/api/test (flutter/flutter#183966)
2026-04-08 [email protected] [fuchsia] Give AOT runners the ability to copy FFI callback thunks. (flutter/flutter#184696)
2026-04-08 [email protected] Add await or ignore lint to invokeMethod callsites (flutter/flutter#182870)
2026-04-08 [email protected] Correctly handle failure to read /proc/self/exe link (flutter/flutter#184700)
2026-04-08 [email protected] Roll Skia from e264d870a380 to e9ed4fc9f154 (11 revisions) (flutter/flutter#184713)
2026-04-08 [email protected] Roll Packages from 5299279 to 0e0a032 (5 revisions) (flutter/flutter#184720)
2026-04-08 [email protected] Roll pub packages (flutter/flutter#184772)
2026-04-08 [email protected] Roll Fuchsia Linux SDK from 1rcChbOv4nSTVkUxs... to pDXMXRIjEHTw7B0sk... (flutter/flutter#184722)
2026-04-08 [email protected] Remove navigator_utils cross-imports from cupertino tests (flutter/flutter#184282)
2026-04-08 [email protected] Even more awaits v2 (flutter/flutter#184552)
2026-04-08 [email protected] Allow personal skills to be gitignored (flutter/flutter#184727)
2026-04-08 [email protected] [ci] mac_arm64 build_test re-enable shard 1 presubmit (flutter/flutter#184751)
2026-04-08 [email protected] Fix repo check on code freeze (flutter/flutter#184771)

If this roll has caused a breakage, revert this CL and stop the roller
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
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
@victorsanni victorsanni deleted the invokeMethod-awaits branch May 5, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems 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.

2 participants