Skip to content

[pigeon] main actor async flutter api - #12729

Merged
auto-submit[bot] merged 7 commits into
flutter:mainfrom
tarrinneal:flutter-api-main-actor
Sep 11, 2026
Merged

auto-submit[bot] merged 7 commits into
flutter:mainfrom
tarrinneal:flutter-api-main-actor

Conversation

@tarrinneal

Copy link
Copy Markdown
Contributor

adds main actor annotation to async flutter api methods in swift.

fixes flutter/flutter#192199

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM other than some test feedback. If we can't come up with a good runtime test, just the Dart unit test for the annotation being there is probably fine.

/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift.
protocol MessageFlutterApiProtocol {
func flutterMethod(aString aStringArg: String?) async throws -> String
@MainActor func flutterMethod(aString aStringArg: String?) async throws -> String

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah, I put it on the protocol itself when I tested locally, but this is probably better since in theory something could implement the protocol (e.g., for tests) and have non-main-actor methods.


/// Returns true if the async FlutterApi method is run on the root isolate.
@async
bool isAsyncFlutterApiOnRoot();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Will this be run under the FFI variant once FFI lands? If not, this is not a useful test method as expressed here, because the engine's platform channel implementation is what controls what isolate Dart receives the message on, not Pigeon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it will

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 3, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 3, 2026
@auto-submit

auto-submit Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/packages/12729, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 11, 2026
@auto-submit
auto-submit Bot merged commit 9caa77c into flutter:main Sep 11, 2026
13 checks passed
pull Bot pushed a commit to Mattlk13/flutter that referenced this pull request Sep 11, 2026
…r#192630)

flutter/packages@8a35b16...9caa77c

2026-09-11 [email protected] [pigeon] main actor async flutter api
(flutter/packages#12729)
2026-09-10 [email protected] [image_picker] Handle a null stream
from openInputStream (flutter/packages#12718)
2026-09-10 [email protected] [material_ui]
1.2.0 sync back clean up (flutter/packages#12829)
2026-09-10 [email protected] [material_ui]
Support custom date input formatters via CalendarDelegate
(flutter/packages#12608)
2026-09-10 [email protected] [in_app_purchase_storekit] Expose
expiration date directly for subscriptions (flutter/packages#11551)
2026-09-10 [email protected] [file_selector_android] Handle a null
stream from openInputStream (flutter/packages#12716)
2026-09-10 [email protected] [pigeon] Add FFI and JNI support to
Swift and Kotlin (flutter/packages#11352)
2026-09-10 [email protected] [material_ui]
Migrate M3 Card defaults to new gen_defaults (flutter/packages#12795)

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-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
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
@bparrishMines

Copy link
Copy Markdown
Contributor

@tarrinneal The release action failed for this PR failed: https://github.com/flutter/packages/actions/runs/34558556002/job/103633472933. How did this version get released on pub.dev? it failing for https://github.com/flutter/packages/actions/runs/35011105115/job/104535469788 as well.

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

I published it; see flutter/flutter#192709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] Swift FlutterApi async methods need @MainActor annotation

3 participants