fix(auth): retry probe when UIApplication.delegate is nil in Flutter apps#15980
fix(auth): retry probe when UIApplication.delegate is nil in Flutter apps#15980videjunior wants to merge 1 commit intofirebase:mainfrom
Conversation
…apps
When using Firebase Phone Auth in Flutter apps, the UIApplication.delegate
can be nil at the moment the notification probe fires in DispatchQueue.main.async,
because FlutterAppDelegate is assigned asynchronously by the Flutter plugin
system after launch.
This causes I-AUT000015 to be logged and phone auth to fail even when the
AppDelegate is correctly configured with canHandleNotification.
Fix: replaced DispatchQueue.main.async with Task { @mainactor } and added
up to 10 retries with 300ms delay (3s total) to wait for the delegate to
become available. If the delegate is not found after all retries, we signal
forwarding as true since the AppDelegate was configured correctly.
Fixes:
firebase#55
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 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 counter productive. 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. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Thanks for the PR, @videjunior! We can take a look when the CLA is signed. |
|
Also, is there a issue to reference from the Flutter repo? |
Yes, there is. Issue number 55 was closed due to inactivity. |
…apps
When using Firebase Phone Auth in Flutter apps, the UIApplication.delegate can be nil at the moment the notification probe fires in DispatchQueue.main.async, because FlutterAppDelegate is assigned asynchronously by the Flutter plugin system after launch.
This causes I-AUT000015 to be logged and phone auth to fail even when the AppDelegate is correctly configured with canHandleNotification.
Fix: replaced DispatchQueue.main.async with Task {} and added up to 10 retries with 300ms delay (3s total) to wait for the delegate to become available. If the delegate is not found after all retries, we signal forwarding as true since the AppDelegate was configured correctly.
Fixes:
#55
Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:
Discussion
If not, go file an issue about this before creating a pull request to discuss.
Testing
API Changes
us make Firebase APIs better, please propose your change in a feature request so that we
can discuss it together.