Summary
When using pendingActionsStream and onIntentExecution together, there is a potential race condition during cold start.
Setup (typical usage)
// In main() — registered early
AppIntents().pendingActionsStream.listen((_) async {
await AppIntents().processPendingActions();
});
// In Widget (e.g., GlobalTabBar) — registered later during widget tree build
AppIntents().onIntentExecution('com.habee.createPost', (params) async {
// handle intent
});
Concern
If processPendingActions() fires before the widget-level onIntentExecution listener is registered (e.g., during cold start when the widget tree hasn't been built yet), the intent execution may be silently dropped.
Request
- Document whether
onIntentExecution callbacks are buffered/replayed when processPendingActions() is called before listeners are registered.
- If events are not buffered, document the recommended initialization order to avoid this race condition.
- Consider adding a replay/buffer mechanism so that intents received during startup are not lost.
Summary
When using
pendingActionsStreamandonIntentExecutiontogether, there is a potential race condition during cold start.Setup (typical usage)
Concern
If
processPendingActions()fires before the widget-levelonIntentExecutionlistener is registered (e.g., during cold start when the widget tree hasn't been built yet), the intent execution may be silently dropped.Request
onIntentExecutioncallbacks are buffered/replayed whenprocessPendingActions()is called before listeners are registered.