fix(app_installations,android): dispatch ID-change events on the main thread - #18652
Conversation
… thread FidListener runs on Firebase's blocking executor, and EventSink.success must be called on the main looper. Fixes #18646
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
Description
FidListener.onFidChanged()is invoked on Firebase's blocking executor. The Android installations plugin was callingEventSink.success()on that background thread, which FlutterJNI rejects (@UiThread).This posts the event onto the main looper (same pattern as Firestore / Functions / Remote Config stream handlers) and unregisters the
FidListenerHandleon cancel.Reproduced on a Pixel_9a emulator with a fresh install: subscribe to
onIdChange, thengetId()+getToken()with no delay. Before the fix, logcat showed:After the fix,
getId/getTokencomplete andonIdChangedelivers the FID with no exception.Related Issues
Checklist
///).melos run analyze) does not report any problems on my PR.Breaking Change