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

Crash on failed authorize_uri that has acs=true query parameter #360

Open
nqtsparda opened this issue Oct 24, 2024 · 8 comments
Open

Crash on failed authorize_uri that has acs=true query parameter #360

nqtsparda opened this issue Oct 24, 2024 · 8 comments
Labels

Comments

@nqtsparda
Copy link

nqtsparda commented Oct 24, 2024

Expected behavior

If there is anything go wrong in Authorizing Payment page, it should show error and guide user what to do next

Actual behavior

  • Using a failed authorize_uri that has query param acs=true makes the app crash on AuthorizingPaymentActivity
  • If there is no acs=true in query param, AuthorizingPaymentActivity still can render error page without problem

Steps to reproduce the issue

  • Setup intent to call to AuthorizingPaymentActivity with a failed authorize uri including acs=true in query param
val intent = Intent(fragment.requireActivity(), AuthorizingPaymentActivity::class.java)
        intent.putExtra(AuthorizingPaymentURLVerifier.EXTRA_AUTHORIZED_URLSTRING, "https://api.omise.co/payments/paym_test_no1t4tnemucod0e51mo/authorize?acs=true")
        intent.putExtra(
            AuthorizingPaymentActivity.EXTRA_THREE_DS_REQUESTOR_APP_URL,
            "deeplink://sample"
        )
        intent.putExtra(
            AuthorizingPaymentURLVerifier.EXTRA_EXPECTED_RETURN_URLSTRING_PATTERNS,
            "https://www.example.com"
        )
  • Crash happens right after landing to AuthorizingPaymentActivity

Logs

 java.lang.RuntimeException: Exception while trying to handle coroutine exception
at
kotlinx.coroutines.CoroutineExceptionHandlerKt.handlerException(CoroutineExceptionHandler.kt:37)
at 
kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:28)
at 
kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:194)
at 
kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:231)
at 
kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:910)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:867) at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:832) 
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: APIError(location=https://www.omise.co/api-errors#not-found, code=not_found, message=Resource was not found)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:119)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createUsingDefault(StdValueInstantiator.java:261)
at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:145)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1608)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1185)
at co.omise.android.models.Serializer.deserialize(SourceFile:2)
at co.omise.android.api.Invocation.processCall(SourceFile:11)
at co.omise.android.api.Invocation.invoke(SourceFile:17)
at co.omise.android.api.Client.send$lambda-0(SourceFile:1)
at co.omise.android.api.Client.$r8$lambda$x9l_k9O6Ac4psrYtKDz-ULIf5VU(Unknown Source:0)
at co.omise.android.api.Client$$ExternalSyntheticLambda1.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [co.omise.android.ui.AuthorizingPaymentViewModel$special$$inlined$CoroutineExceptionHandler$1@800ebe7, StandaloneCoroutine{Cancelling}@bef0394, Dispatchers.IO]
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property transaction has not been initialized
at co.omise.android.ThreeDS2ServiceWrapper.getTransaction(SourceFile:1)
at co.omise.android.ui.AuthorizingPaymentViewModel$special$$inlined$CoroutineExceptionHandler$1.handleException(SourceFile:2)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:24)
... 14 more

Screenshots

No response

Name and version information

Omise SDK 5.3.0

@nqtsparda nqtsparda added the bug label Oct 24, 2024
@AnasNaouchi
Copy link
Collaborator

Hello @nqtsparda ,
Thank you for reaching out ,
We are aware of this issue and a release is expected to be released soon .
Please wait till the new release is out.

@AnasNaouchi
Copy link
Collaborator

@nqtsparda Version v5.4.0 has been released, please help us confirm that the issue has been fixed on your end.
Thank you.

@juckrit
Copy link

juckrit commented Oct 25, 2024

v5.4.0 still has problem

@nqtsparda
Copy link
Author

The crash seems from this

lateinit prop threeDS2Service.transaction does not get initialized before using

@AnasNaouchi
Copy link
Collaborator

The crash seems from this

lateinit prop threeDS2Service.transaction does not get initialized before using

Yes we have already identified the cause, so may i ask if you have modified the auth_uri yourself or you received this uri from the charge response ?

@nqtsparda
Copy link
Author

To make it easier to reproduce the crash so I made up above 404 authorize uri
In our system real use case, we received that authorize uri from charge response

@juckrit
Copy link

juckrit commented Oct 28, 2024

There is no problem on Prod env. I already tried

@AnasNaouchi
Copy link
Collaborator

Hello @juckrit @nqtsparda ,
Thank you for your patience,
We have identified the root cause and the potential solution but no specific timeline has been decided. We hope to release a fix soon.
If you still have any concerns please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants