You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[pigeon] Swift FlutterApi async methods need @MainActor annotation #192199
I tried adopting the new async support as part of completing the google_maps_flutter migration to Swift, and while doing manual testing I was seeing engine logging telling me that I (via Pigeon) was sending messages from the wrong thread.
I'm still new to Swift's new concurrency model, but based on Gemini debugging (which I believe is correct based on my follow-up reading), the issue is that when there is no actor annotation, the default behavior is that any await call can jump threads. So even if clients are careful to call FlutterApi calls from the main thread, as soon as they await any given FlutterApi method call, it's likely to jump to a background thread, and send the message from there.
I verified locally that annotating the entire *Protocol generated for the FlutterApi as @MainActor fixed it.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[pigeon] main actor async flutter api (flutter#12729)
[google_maps_flutter] Adopts new async/await Swift Pigeon support (#1…
github-actions commentedon Sep 25, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.