Description
When a Firebase Auth blocking function (e.g. beforeUserCreated) times out, the Android SDK throws an error with code UNKNOWN (error code 47) instead of a dedicated, meaningful error code.
This makes it impossible for developers to programmatically distinguish between a genuine internal error and a blocking function timeout, leading to hours of debugging.
Steps to Reproduce
- Set up a
beforeUserCreated blocking function that takes longer than the allowed timeout.
- Call
createUserWithEmailAndPassword (or any auth method guarded by the blocking function) from an Android app.
- Observe the exception: it surfaces as
UNKNOWN / error code 47 with a generic message like "An internal error has occurred."
Expected Behavior
A dedicated error code (e.g. BLOCKING_FUNCTION_TIMEOUT or similar) should be returned so that developers can handle this case explicitly.
Actual Behavior
The error is surfaced as UNKNOWN (error code 47):
Error code: 47
Message: An internal error has occurred.
From Flutter/FlutterFire (where this was originally reported):
[firebase_auth/unknown] An internal error has occurred. [ Error code:47
FirebaseAuthException
Firebase Auth error code: unknown
Firebase Auth error message: An internal error has occurred. [ Error code:47
Context
This was reported on the FlutterFire repository: firebase/flutterfire#18022
The FlutterFire maintainer confirmed that error codes and messages are passed through as-is from the native Android SDK, and recommended opening this issue upstream to request a dedicated error code for blocking function timeouts.
A dedicated error code would benefit all Firebase Auth consumers on Android (native and cross-platform via FlutterFire, React Native Firebase, etc.).
Platform
- Android (Firebase Auth Android SDK)
- Also surfaced via FlutterFire (Flutter wrapper)
Description
When a Firebase Auth blocking function (e.g.
beforeUserCreated) times out, the Android SDK throws an error with codeUNKNOWN(error code 47) instead of a dedicated, meaningful error code.This makes it impossible for developers to programmatically distinguish between a genuine internal error and a blocking function timeout, leading to hours of debugging.
Steps to Reproduce
beforeUserCreatedblocking function that takes longer than the allowed timeout.createUserWithEmailAndPassword(or any auth method guarded by the blocking function) from an Android app.UNKNOWN/ error code 47 with a generic message like "An internal error has occurred."Expected Behavior
A dedicated error code (e.g.
BLOCKING_FUNCTION_TIMEOUTor similar) should be returned so that developers can handle this case explicitly.Actual Behavior
The error is surfaced as
UNKNOWN(error code 47):From Flutter/FlutterFire (where this was originally reported):
Context
This was reported on the FlutterFire repository: firebase/flutterfire#18022
The FlutterFire maintainer confirmed that error codes and messages are passed through as-is from the native Android SDK, and recommended opening this issue upstream to request a dedicated error code for blocking function timeouts.
A dedicated error code would benefit all Firebase Auth consumers on Android (native and cross-platform via FlutterFire, React Native Firebase, etc.).
Platform