Is there an existing issue for this?
Which plugins are affected?
Auth
Which platforms are affected?
Windows
Description
On Windows, firebase_auth calls this unconditionally in the native plugin constructor:
FirebaseAuthPlugin::FirebaseAuthPlugin() {
firebase::SetLogLevel(firebase::kLogLevelVerbose);
}
In my app this turns a cold Firebase.initializeApp from sub-second into ~60 seconds.
A/B result:
With the firebase_auth constructor line restored:
App::Create exit ms=30009
Auth::GetAuth exit ms=10002
current_user exit ms=20018 valid=true
GetPluginConstantsForFirebaseApp exit ms=30026
Firebase.initializeApp returned after 60667ms
With only this line disabled:
// firebase::SetLogLevel(firebase::kLogLevelVerbose);
and with firebase_auth registration/constants otherwise restored normally:
App::Create exit ms=3
Auth::GetAuth exit ms=2
current_user exit ms=2 valid=true
GetPluginConstantsForFirebaseApp exit ms=5
Firebase.initializeApp returned after 733ms
Suspected cause:
SetLogLevel(kLogLevelVerbose) enables Firebase C++ LogDebug(...) calls. On Windows, the Firebase C++ stdio logger writes through OutputDebugString(...). The slowdown pattern matches roughly one blocking debug-output write per Firebase debug log.
Expected behavior:
firebase_auth should not globally force verbose Firebase C++ SDK logging for every Windows app.
Possible fix:
Remove or gate:
firebase::SetLogLevel(firebase::kLogLevelVerbose);
behind an explicit diagnostic/debug opt-in.
Reproducing the issue
- Create or use a Flutter Windows app with:
firebase_core: 4.11.0
firebase_auth: 6.5.4
-
Ensure the Windows app has a cached signed-in Firebase Auth session.
-
Add temporary timing logs around the Windows native Firebase.initializeApp path:
firebase_core/windows/firebase_core_plugin.cpp: time firebase::App::Create(...)
firebase_auth/windows/firebase_auth_plugin.cpp: time Auth::GetAuth(...), auth->current_user(), and GetPluginConstantsForFirebaseApp(...)
-
Run the app on Windows with the stock firebase_auth Windows plugin code:
FirebaseAuthPlugin::FirebaseAuthPlugin() {
firebase::SetLogLevel(firebase::kLogLevelVerbose);
}
- Observe that cold
Firebase.initializeApp blocks for about 60 seconds. In my run:
App::Create exit ms=30009
Auth::GetAuth exit ms=10002
current_user exit ms=20018 valid=true
GetPluginConstantsForFirebaseApp exit ms=30026
Firebase.initializeApp returned after 60667ms
- Comment out only this line in
firebase_auth/windows/firebase_auth_plugin.cpp:
// firebase::SetLogLevel(firebase::kLogLevelVerbose);
-
Rebuild and run the same app state again.
-
Observe that cold Firebase.initializeApp returns in under a second. In my run:
App::Create exit ms=3
Auth::GetAuth exit ms=2
current_user exit ms=2 valid=true
GetPluginConstantsForFirebaseApp exit ms=5
Firebase.initializeApp returned after 733ms
The only behavioral difference between the slow and fast run was whether the firebase_auth Windows plugin constructor called firebase::SetLogLevel(firebase::kLogLevelVerbose);.
Firebase Core version
4.11.0
Flutter Version
3.44.1
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
Is there an existing issue for this?
Which plugins are affected?
Auth
Which platforms are affected?
Windows
Description
On Windows,
firebase_authcalls this unconditionally in the native plugin constructor:In my app this turns a cold Firebase.initializeApp from sub-second into ~60 seconds.
A/B result:
With the firebase_auth constructor line restored:
With only this line disabled:
// firebase::SetLogLevel(firebase::kLogLevelVerbose);
and with firebase_auth registration/constants otherwise restored normally:
Suspected cause:
SetLogLevel(kLogLevelVerbose) enables Firebase C++ LogDebug(...) calls. On Windows, the Firebase C++ stdio logger writes through OutputDebugString(...). The slowdown pattern matches roughly one blocking debug-output write per Firebase debug log.
Expected behavior:
firebase_auth should not globally force verbose Firebase C++ SDK logging for every Windows app.
Possible fix:
Remove or gate:
behind an explicit diagnostic/debug opt-in.
Reproducing the issue
Ensure the Windows app has a cached signed-in Firebase Auth session.
Add temporary timing logs around the Windows native
Firebase.initializeApppath:firebase_core/windows/firebase_core_plugin.cpp: timefirebase::App::Create(...)firebase_auth/windows/firebase_auth_plugin.cpp: timeAuth::GetAuth(...),auth->current_user(), andGetPluginConstantsForFirebaseApp(...)Run the app on Windows with the stock
firebase_authWindows plugin code:Firebase.initializeAppblocks for about 60 seconds. In my run:firebase_auth/windows/firebase_auth_plugin.cpp:// firebase::SetLogLevel(firebase::kLogLevelVerbose);Rebuild and run the same app state again.
Observe that cold
Firebase.initializeAppreturns in under a second. In my run:The only behavioral difference between the slow and fast run was whether the
firebase_authWindows plugin constructor calledfirebase::SetLogLevel(firebase::kLogLevelVerbose);.Firebase Core version
4.11.0
Flutter Version
3.44.1
Relevant Log Output
Flutter dependencies
Expand
Flutter dependenciessnippetReplace this line with the contents of your `flutter pub deps -- --style=compact`.Additional context and comments
No response