Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signInWithEmailAndPassword() coroutine hangs on error #7

Closed
fmasa opened this issue Apr 7, 2024 · 5 comments · Fixed by #9
Closed

signInWithEmailAndPassword() coroutine hangs on error #7

fmasa opened this issue Apr 7, 2024 · 5 comments · Fixed by #9

Comments

@fmasa
Copy link
Contributor

fmasa commented Apr 7, 2024

When the email is invalid, the password is invalid, or the email is not found, the API returns 400 with an error payload. From that the error.message JSON field should be passed as errorCode to the FirebaseException constructor.

Right now HTTP message (which is an empty string) is passed instead and since the FirebaseException requires the error code to be not empty, the constructor throws an exception. This exception is not passed to Task and the coroutine is never resumed.

Exception in thread "OkHttp Dispatcher" java.lang.IllegalArgumentException: Given String is empty or null
	at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(com.google.android.gms:play-services-basement@@18.1.0:2)
	at com.google.firebase.auth.FirebaseAuthException.<init>(com.google.firebase:firebase-auth-interop@@20.0.0:2)
	at com.google.firebase.auth.FirebaseAuthInvalidUserException.<init>(FirebaseAuthInvalidUserException.kt:3)
	at com.google.firebase.auth.FirebaseAuth$signInWithEmailAndPassword$1.onResponse(FirebaseAuth.kt:248)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
@nbransby
Copy link
Member

nbransby commented Apr 8, 2024

Will look at this when we can, a PR would def speed up the process thanks!

@fmasa
Copy link
Contributor Author

fmasa commented Apr 9, 2024

@nbransby I wanted to do that, but I couldn't get the library to build.

@nbransby
Copy link
Member

nbransby commented Apr 9, 2024

@fmasa
Copy link
Contributor Author

fmasa commented Apr 10, 2024

@nbransby I sort of got this to work, but there were some problems (I opened #10 for that).

I created the PR #9

@taetae98coding
Copy link
Contributor

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants