Skip to content

GoogleSignIn plugin should clear its state if an unrecoverable error occurs #10552

@mehmetf

Description

@mehmetf

We should clear the state of signin (either via signout or via setting currentUser to null) if the currentUser object is not valid. Otherwise the app gets into a crash loop where signIn constantly tries to return the invalid currentUser.

Stack trace from various users of leafy:

05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525): Failed to handle method call
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525): java.lang.NullPointerException: null value in entry: displayName=null
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:34)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:214)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.google.android.flutter.plugins.googlesignin.GoogleSignInListener.onSignInResult(GoogleSignInListener.java:372)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.google.android.flutter.plugins.googlesignin.GoogleSignInListener.signInSilently(GoogleSignInListener.java:213)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.google.android.flutter.plugins.googlesignin.GoogleSignInListener.onMethodCall(GoogleSignInListener.java:110)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at io.flutter.view.FlutterView.handlePlatformMessage(FlutterView.java:609)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at android.os.MessageQueue.nativePollOnce(Native Method)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at android.os.MessageQueue.next(MessageQueue.java:323)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at android.os.Looper.loop(Looper.java:136)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at android.app.ActivityThread.main(ActivityThread.java:6121)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at java.lang.reflect.Method.invoke(Native Method)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
05-19 08:59:01.149 E/MethodChannel#plugins.flutter.io/google_sign_in(14525):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions