quickstart-android icon indicating copy to clipboard operation
quickstart-android copied to clipboard

Why does Firebase pendingAuthResult return null when the app is killed?

Open pesathem opened this issue 5 years ago • 10 comments

Step 1: Describe your environment

  • Android device: Xiaomi Mi A1
  • Android OS version: Android 8.1.0
  • Google Play Services version: 4.3.3
  • Firebase-core version: 17.2.1
  • Firebase-auth version: 19.2.0

Step 2: Describe the problem:

When the app in the background is killed while performing Apple sign-in in Chrome, the authentication behaves inconsistently.

Steps to reproduce:

  1. Go to GenericIdpActivity
  2. Start the Apple sign-in flow
  3. Before finishing the sign-in flow, terminate the app in Android Studio to simulate system killing the app
  4. Finish signing in
  5. Both auth.currentUser and auth.pendingAuthResult are null in onStart()

Observed Results:

If I then restart the app, I am suddenly signed in and the pending result is present. And it doesn't disappear no matter what I do.

Expected Results:

The pending result shouldn't be null if the app is killed while in the background. That is the whole point of the pending result. Generally, the current behavior when the app is killed seems really inconsistent and buggy.

Related SO question:

https://stackoverflow.com/questions/59718353/why-does-firebase-pendingauthresult-return-null

pesathem avatar Jan 15 '20 16:01 pesathem

Any update on this?

pesathem avatar Jan 24 '20 15:01 pesathem

Hello, will there be an update on this or is it better to post this issue somewhere else?

pesathem avatar May 20 '20 08:05 pesathem

@pesathem apologies I should have looked at this sooner. I do not know the answer, @malcolmdeck do you know if the quickstart has a mistake or if maybe there is something going on with the SDK?

samtstern avatar May 20 '20 19:05 samtstern

I've shared an item with you:

File_003 https://drive.google.com/file/d/1SoXBVJqLc0BCtlXbmExjjUwoGTxcLEC1/view?usp=sharing&invite=CJmxxfEH&ts=5ecde669

It's not an attachment -- it's stored online. To open this item, just click
the link above.

papabeckum007 avatar May 27 '20 04:05 papabeckum007

I've shared an item with you:

File_002.txt https://drive.google.com/file/d/1FXjj3OmHJMIAuR24_RkN7ngWia_jGAd8/view?usp=sharing&invite=CJCH0B0&ts=5ecde669

It's not an attachment -- it's stored online. To open this item, just click
the link above.

papabeckum007 avatar May 27 '20 04:05 papabeckum007

I've shared an item with you:

File_001.png https://drive.google.com/file/d/1ZJcyXbsqetuVSocReiYdyB9GS6Eb2S_5/view?usp=sharing&invite=CIX6xsEI&ts=5ecde669

It's not an attachment -- it's stored online. To open this item, just click
the link above.

papabeckum007 avatar May 27 '20 04:05 papabeckum007

This is being tracked internally in b/157154451

malcolmdeck avatar May 28 '20 16:05 malcolmdeck

I am using v19.3.2, behavior i get is: firebaseAuth.pendingAuthResult is null after returning from apple sign-in browser, while "Dont keep activities" is checked.

jemshit avatar Jul 27 '20 12:07 jemshit

Same here with v20.0.1, any update on this?

lenoch0d avatar Dec 14 '20 11:12 lenoch0d

Any update?

jemshit avatar Nov 26 '21 09:11 jemshit