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

Wrong error message when device is offline #151

Closed
2 tasks done
pmellaaho opened this issue May 29, 2024 · 4 comments
Closed
2 tasks done

Wrong error message when device is offline #151

pmellaaho opened this issue May 29, 2024 · 4 comments
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working

Comments

@pmellaaho
Copy link

Before creating a new issue, please confirm:

Which UI component?

Authenticator

Gradle script dependencies

// Put output below this line
authenticatorVersion = "1.1.0"

Environment information

# Put output below this line
Gradle 8.6

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

The Authenticator is showing wrong error message's when e.g. device is offline and user tries to Sign-in. In can see that there is a valid text ("Please check your connectivity") defined for these cases but it just isn't used. It seems that AuthenticatorViewModel is mapping UnknownHostException -cause to the this error message but for some reason the mapping code doesn't work and ambigious "Sorry, something went wrong" -message is shown to the user. With AndroidLoggingPlugin enabled I can see the following lines in Logcat:

Auth State Change: Configured(authNState=SigningIn(signInState=SigningInWithSRP(srpSignInState=Error(exception=aws.smithy.kotlin.runtime.http.HttpException: java.net.UnknownHostException: Unable to resolve host "cognito-idp.eu-central-1.amazonaws.com": No address associated with hostname))), authZState=SigningIn(id=)) Auth State Change: Configured(authNState=SignedOut(signedOutData=SignedOutData(lastKnownUsername=null, hostedUIErrorData=null, globalSignOutErrorData=null, revokeTokenErrorData=null)), authZState=Configured(id=))

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line
Auth State Change: Configured(authNState=SigningIn(signInState=SigningInWithSRP(srpSignInState=Error(exception=aws.smithy.kotlin.runtime.http.HttpException: java.net.UnknownHostException: Unable to resolve host "cognito-idp.eu-central-1.amazonaws.com": No address associated with hostname))), authZState=SigningIn(id=))
Auth State Change: Configured(authNState=SignedOut(signedOutData=SignedOutData(lastKnownUsername=null, hostedUIErrorData=null, globalSignOutErrorData=null, revokeTokenErrorData=null)), authZState=Configured(id=))

amplifyconfiguration.json

No response

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label May 29, 2024
@mattcreaser mattcreaser added authenticator This issue relates to the Authenticator component bug Something isn't working labels May 29, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label May 29, 2024
@mattcreaser
Copy link
Member

Thanks for this report @pmellaaho. We'll look into why this exception isn't being mapped.

@mattcreaser
Copy link
Member

Looks like Authenticator is looking for a direct cause of UnknownHostException, but there's an extra layer of HttpException wrapping the UnknownHostException. Authenticator should search through the causes instead of only looking one level deep.

@mattcreaser mattcreaser added the pending-release This issue has been fixed and will be included in a future release label Jun 3, 2024
@mattcreaser
Copy link
Member

This has been resolved in Authenticator 1.2.1

@github-actions github-actions bot removed the pending-release This issue has been fixed and will be included in a future release label Jun 7, 2024
Copy link
Contributor

github-actions bot commented Jun 7, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authenticator This issue relates to the Authenticator component bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants