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

[Bug]: IllegalStateException: Reply already submitted #152

Open
2 tasks done
joelsuite opened this issue Jan 9, 2025 · 0 comments
Open
2 tasks done

[Bug]: IllegalStateException: Reply already submitted #152

joelsuite opened this issue Jan 9, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@joelsuite
Copy link

joelsuite commented Jan 9, 2025

Description

Currently in our ios and android app we are calling the FlutterWebAuth2.authenticate method. For the majority of users on both ios and android this works with no problem. However, for a number of Samsung models we encounter the following:

IllegalStateException: Reply already submitted

Our logging package informs us that this error is being thrown when the following is called:

flutter_web_auth_2.dart in FlutterWebAuth2._cleanUpDanglingCalls at line 93 within flutter_web_auth_2

We believe this is originating from the native code backing the flutter_web_auth_2 package rather than being a problem with how we have called authenticate.

Minimal Reproduction

Steps to reproduce the behaviour:

We have been unable to reproduce this problem ourselves as it appears to occur in specific models of phone, that we do not currently use for testing.

Our call to authenticate is as follows:

     String result = await FlutterWebAuth2.authenticate(
      url: authorizeUrl.toString(),
      callbackUrlScheme: Platform.isIOS ? "churchsuite" : "https",
    ).onError((error, stackTrace) {
      // throw anything that needs throwing!
      logError(error.toString(), stackTrace: stackTrace);
      if (error is Exception) throw error;
      return '';
    });

I realise this is less than ideal, so please ask any clarifying questions if that would be helpful.

Exception or Error

PlatformException(error, Reply already submitted, null, java.lang.IllegalStateException: Reply already submitted
	at t6.c$g.a(DartMessenger.java:4)
	at f7.k$a$a.error(MethodChannel.java:1)
	at com.linusu.flutter_web_auth_2.a.onMethodCall(FlutterWebAuth2Plugin.kt:18)
	at f7.k$a.a(MethodChannel.java:2)
	at t6.c.l(DartMessenger.java:2)
	at t6.c.m(DartMessenger.java:4)
	at t6.c.i(Unknown Source:0)
	at t6.b.run(Unknown Source:12)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8669)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
)

Expected Behaviour

After clicking login on this app we expect the user to proceed to our oAuth login screen and then return to our app having successfully completed our login flow.

Screenshots

image

Screenshot 2025-01-09 at 14 00 39

Screenshot 2025-01-09 at 14 00 58

Additional context

No response

Device

Samsung A21s

OS

Android 12

Browser

stock

Flutter version

3.27.0

flutter_web_auth_2 version

4.0.1

Checklist

  • I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
  • I have provided all the information I can.
@joelsuite joelsuite added the bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants