tangem-sdk-android icon indicating copy to clipboard operation
tangem-sdk-android copied to clipboard

TangemSdk.sign invokes both Success and Failure

Open muratogat opened this issue 2 years ago • 10 comments

Using:

implementation "com.github.tangem.tangem-sdk-android:core:3.8.2"
implementation "com.github.tangem.tangem-sdk-android:android:3.8.2"

When I try to get something signed using TangemSdk.sign , after successfully signing and getting the CompletionResult.Success , also the CompletionResult.Failure is invoked unexpectedly.

To be clear, the the Success part works OK and has the correct signature. So things seem to work fine, until the Failure is also triggered. It doesn't cause problems when the failure is ignored, but if a failure message is displayed or some code is run when Tangem signing fails, it breaks the proper operation.

The code I receive in the Failure TangemSdkError is 50002 . Perhaps this has something to do with cards setup with the older Tangem app. Perhaps not.

Could you please check?

muratogat avatar Nov 26 '23 20:11 muratogat

Hey Tangem team, any updates here?

KostasZav avatar Dec 12 '23 10:12 KostasZav

@lazutkin-andrey @mobile-tangem can you please provide some feedback about this issue?

KostasZav avatar Dec 18 '23 14:12 KostasZav

We'll check it and give feedback.

kozarezvlad avatar Dec 19 '23 08:12 kozarezvlad

@lazutkin-andrey @mobile-tangem @kozarezvlad any updates here?

KostasZav avatar Jan 22 '24 08:01 KostasZav

Check it in version 3.9.1.

Code 50002 happens when dialog has been closed by user interaction with BottomSheet, otherwise it shouldn't throws.

If error still happens in 3.9.1, let us know.

kozarezvlad avatar Feb 03 '24 15:02 kozarezvlad

Yes unfortunately I still see this behavior in 3.9.1 I am definitely not closing the popup with user interaction. The flow is:

  • App requests signature
  • I trigger TangemSDK
  • Card scan popup is displayed, I scan the card
  • Pin is asked, I enter the pin
  • The success sheet is shown with the check, then it closes itself
  • To my wallet both Success and Failure callbacks are returned, with the Success having the correct signature and Failure having the code 50002

What could be the reason that 50002 is triggered even though the user doesn't close this popup manually?

muratogat avatar Mar 22 '24 08:03 muratogat

We're looking your case

kozarezvlad avatar Apr 18 '24 17:04 kozarezvlad

Fix has been merged in develop branch. You can try it with tag develop-350

kozarezvlad avatar Apr 22 '24 14:04 kozarezvlad

Yes, I confirm this solves the issue. Many thanks. Please kindly merge into next main release.

muratogat avatar May 15 '24 21:05 muratogat

When could we expect a release including this fix? I would really not like to ship a version that has a develop version of TangemSDK integrated. Thanks.

muratogat avatar Jun 06 '24 08:06 muratogat