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

discoverReaders calls completion with error when cancelled #272

Closed
r2-pro opened this issue Nov 23, 2023 · 1 comment · Fixed by #281
Closed

discoverReaders calls completion with error when cancelled #272

r2-pro opened this issue Nov 23, 2023 · 1 comment · Fixed by #281

Comments

@r2-pro
Copy link

r2-pro commented Nov 23, 2023

Summary

Despite documentation stating:

@note If discoverReaders is canceled, the completion block will be called
with nil (rather than an SCPErrorCanceled error).

SDK calls completion block of discoverReaders with an error.

(lldb) print (error.self as NSError).userInfo
([String : Any]) 2 key/value pairs {
  [0] = {
    key = "com.stripe-terminal:Message"
    value = (object = 0x0000000283e1f720)
  }
  [1] = {
    key = "NSLocalizedDescription"
    value = (object = 0x0000000283e1f720)
  }
}
(lldb) po 0x0000000283e1f720
discoverReaders was canceled.
(lldb) po 0x0000000283e1f720
discoverReaders was canceled.

iOS version

17.0.3

Installation method

SPM

SDK version

3.1.0

@bric-stripe
Copy link
Collaborator

@r2-pro sorry for the confusion here, and thanks for reporting. This was a change made in 3.0 and is called out in the changelog

Update: Canceling discoverReaders now completes with an SCPErrorCanceled error. Previously no error was provided when canceled.

but we missed updating that note. I'll make sure this gets fixed up in the 3.3 release. But for now the behavior you're seeing in the expected behavior in 3.x SDKs.

fwiw this was for consistency with other commands that report the cancelled error as well as consistency with the Android SDK.

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

Successfully merging a pull request may close this issue.

2 participants