Bug report
On Windows, User.reauthenticateWithCredential() never completes when the credential is valid. The returned Future stays pending forever. An invalid credential rejects normally.
FirebaseAuthPlugin::ReauthenticateWithCredential in the Windows plugin only invokes the Pigeon result callback on the error branch:
// windows/firebase_auth_plugin.cpp
firebase::Future<void> future =
user.Reauthenticate(getCredentialFromArguments(input, app));
future.OnCompletion([result](const firebase::Future<void>& completed_future) {
if (completed_future.error() == 0) {
// TODO: wrong return type
} else {
result(FirebaseAuthPlugin::ParseError(completed_future));
}
});
User::Reauthenticate() in the C++ SDK returns Future<void>, but the Pigeon signature expects an InternalUserCredential, so the success branch was left empty. Nothing calls result and the Dart side waits forever. It is the only method in the file that returns nothing on success: ReauthenticateWithProvider just below calls result(credential), and Reload deals with the same Future<void> shape by reading firebaseAuth->current_user() once the future completes and building the reply from that.
Steps to reproduce
- Run a Flutter Windows app with an email/password Firebase user signed in.
- Call:
final cred = EmailAuthProvider.credential(email: user.email!, password: correctPassword);
await user.reauthenticateWithCredential(cred);
print('never printed');
- Pass the correct password.
Expected
The future completes with a UserCredential, as it does on Android, iOS, macOS and web.
Actual
The future never completes, with no error and no exception. Anything awaiting it is stuck until the process exits.
A wrong password completes normally with a FirebaseAuthException, since the error branch calls result.
Impact
Any Windows flow that requires credential reauthentication first cannot complete. Ours is the account email-change flow, where reauthenticateWithCredential runs ahead of verifyBeforeUpdateEmail. The verification email is never requested and the user sees nothing happen. verifyBeforeUpdateEmail is implemented correctly, it just isn't reached.
Possible fix
Reload already shows the pattern for a Future<void> C++ call that has to return a richer Pigeon type: read the current user after completion and construct the reply from it.
Version
firebase_auth 6.5.7. The same code is in 6.6.1 (current latest) at the same place.
Bug report
On Windows,
User.reauthenticateWithCredential()never completes when the credential is valid. The returnedFuturestays pending forever. An invalid credential rejects normally.FirebaseAuthPlugin::ReauthenticateWithCredentialin the Windows plugin only invokes the Pigeonresultcallback on the error branch:User::Reauthenticate()in the C++ SDK returnsFuture<void>, but the Pigeon signature expects anInternalUserCredential, so the success branch was left empty. Nothing callsresultand the Dart side waits forever. It is the only method in the file that returns nothing on success:ReauthenticateWithProviderjust below callsresult(credential), andReloaddeals with the sameFuture<void>shape by readingfirebaseAuth->current_user()once the future completes and building the reply from that.Steps to reproduce
Expected
The future completes with a
UserCredential, as it does on Android, iOS, macOS and web.Actual
The future never completes, with no error and no exception. Anything awaiting it is stuck until the process exits.
A wrong password completes normally with a
FirebaseAuthException, since the error branch callsresult.Impact
Any Windows flow that requires credential reauthentication first cannot complete. Ours is the account email-change flow, where
reauthenticateWithCredentialruns ahead ofverifyBeforeUpdateEmail. The verification email is never requested and the user sees nothing happen.verifyBeforeUpdateEmailis implemented correctly, it just isn't reached.Possible fix
Reloadalready shows the pattern for aFuture<void>C++ call that has to return a richer Pigeon type: read the current user after completion and construct the reply from it.Version
firebase_auth 6.5.7. The same code is in 6.6.1 (current latest) at the same place.