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

Connecting to a new instance of Firebase emulator without redoing login causes refresh token problems #40

Open
grodin opened this issue Nov 11, 2021 · 4 comments
Labels
bug Something isn't working needs investigation
Milestone

Comments

@grodin
Copy link
Collaborator

grodin commented Nov 11, 2021

Launching the app to point at a new firebase emulator instance seems to prevent token refresh working properly.

The symptom of this I'm seeing is that Firebase Auth returnsa non-null user, but then nothing is returned when listing the maps for that user. Looking at the logs, there's this warning:

2021-11-11 10:57:48.782 2295-2335/com.omricat.maplibrarian W/Firestore: (22.0.2) [FirestoreCallCredentials]: Failed to get token: com.google.firebase.FirebaseException: An internal error has occurred. [ INVALID_REFRESH_TOKEN ]. 2021-11-11 10:57:48.840 2295-2335/com.omricat.maplibrarian W/Firestore: (22.0.2) [WatchStream]: (a735d52) Stream closed with status: Status{code=UNAUTHENTICATED, description=null, cause=com.google.firebase.FirebaseException: An internal error has occurred. [ INVALID_REFRESH_TOKEN ] at com.google.android.gms.internal.firebase-auth-api.zztt.zza(com.google.firebase:firebase-auth@@20.0.2:4) at com.google.android.gms.internal.firebase-auth-api.zzvb.zza(com.google.firebase:firebase-auth@@20.0.2:9) at com.google.android.gms.internal.firebase-auth-api.zzvc.zzk(com.google.firebase:firebase-auth@@20.0.2:1) at com.google.android.gms.internal.firebase-auth-api.zzuz.zzh(com.google.firebase:firebase-auth@@20.0.2:25) at com.google.android.gms.internal.firebase-auth-api.zztq.zzk(com.google.firebase:firebase-auth@@20.0.2:1) at com.google.android.gms.internal.firebase-auth-api.zzor.zza(com.google.firebase:firebase-auth@@20.0.2:2) at com.google.android.gms.internal.firebase-auth-api.zzvg.zza(com.google.firebase:firebase-auth@@20.0.2:25) at com.google.android.gms.internal.firebase-auth-api.zzuq.zzb(com.google.firebase:firebase-auth@@20.0.2:4) at com.google.android.gms.internal.firebase-auth-api.zzpy.zza(com.google.firebase:firebase-auth@@20.0.2:4) at com.google.android.gms.internal.firebase-auth-api.zztu.zzb(com.google.firebase:firebase-auth@@20.0.2:5) at com.google.android.gms.internal.firebase-auth-api.zzqw.zzd(Unknown Source:15) at com.google.android.gms.internal.firebase-auth-api.zzqv.accept(Unknown Source:6) at com.google.android.gms.common.api.internal.zacj.doExecute(com.google.android.gms:play-services-base@@17.1.0:2) at com.google.android.gms.common.api.internal.zaf.zac(com.google.android.gms:play-services-base@@17.1.0:6) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zac(com.google.android.gms:play-services-base@@17.1.0:167) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zab(com.google.android.gms:play-services-base@@17.1.0:139) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabg(com.google.android.gms:play-services-base@@17.1.0:99) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabe(com.google.android.gms:play-services-base@@17.1.0:40) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnected(com.google.android.gms:play-services-base@@17.1.0:19) at com.google.android.gms.common.internal.zaf.onConnected(com.google.android.gms:play-services-base@@17.1.0:2) at com.google.android.gms.common.internal.BaseGmsClient$zzg.zzj(com.google.android.gms:play-services-basement@@17.1.0:24) at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(com.google.android.gms:play-services-basement@@17.1.0:12) at com.google.android.gms.common.internal.BaseGmsClient$zzb.zzo(com.google.android.gms:play-services-basement@@17.1.0:11) at com.google.android.gms.common.internal.BaseGmsClient$zzc.handleMessage(com.google.android.gms:play-services-basement@@17.1.0:49) at android.os.Handler.dispatchMessage(Handler.java:106) at com.google.android.gms.internal.common.zzi.dispatchMessage(com.google.android.gms:play-services-basement@@17.1.0:8) at android.os.Looper.loop(Looper.java:164) at android.os.HandlerThread.run(HandlerThread.java:65) }.

The trouble is this exception isn't thrown to my code so I can't do anything about it. That it isn't thrown is the basis of my belief that this is an interaction with the emulator.

@grodin grodin added the bug Something isn't working label Nov 11, 2021
@grodin grodin added this to the 0.1 milestone Nov 11, 2021
@grodin
Copy link
Collaborator Author

grodin commented Mar 16, 2022

This is possibly an instance of #70 with the exception getting swallowed

More likely, caused by #62

@grodin
Copy link
Collaborator Author

grodin commented Apr 1, 2022

Probably related

@enchance
Copy link

enchance commented Oct 28, 2022

Same here @grodin. If only there were some way to catch that exception so we could do something about it. My intention is to force logout the user so they could go back to the Sign-in screen.

I see the exception, I'm trying to catch the exception; Firebase instead throws an egg at my face. Three points.

@grodin
Copy link
Collaborator Author

grodin commented Mar 14, 2023

I think this was actually #62 . Leaving open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants