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

Warning: This code path does I/O on the main thread underneath that can lead to Ul responsiveness issues -[NSFileManager removeltemAtPath:error:] #296

Open
JUSTINMKAUFMAN opened this issue Apr 1, 2024 · 1 comment

Comments

@JUSTINMKAUFMAN
Copy link

JUSTINMKAUFMAN commented Apr 1, 2024

Summary

Since updating to the latest Xcode v15.3 (15E204a), I see several runtime warnings related to this library doing I/O on the main thread.

While I can't look at the actual code that the stack trace references, it appears as though the proximate trigger for the warnings are the following methods:

  • NSFileManager.removeItemAtPath:
  • NSFileManager.createFileAtPath:
  • NSBundle.bundleIdentifier:
  • NSKeyedArchiver.archivedDataWithRootObject:
  • NSData.enumerateByteRangesUsingBlock:

And those calls appear to stem from the following SDK operations:

  • Disconnecting/connecting to/from a reader (SCPBbposBluetoothScanAdapter.onBTConnected:, SCPBbposBluetoothScanAdapter.onBTDisconnected:)
  • Reconnecting to a reader (SCPTerminal.reconnectOrAnnounceUnexpectedDisconnect...)
  • Refreshing location (SCPLocationManager.refreshLocation:)
  • Getting device info (DP_MainController.getDeviceInfo_Internal:)
  • Canceling card read (DP_MainController.cancelCheckCard:)

Code to reproduce

I don't think there is anything off-book about my use of the SDK (I'm guessing the source of these warnings has been around for a while and that Xcode only recently started surfacing them, though I could be wrong).

iOS version

17.1

Installation method

SPM

SDK version

3.4.0

Other information

I'm happy to provide anything else that may be useful! Thanks.

StripeTerminalTraceA
StripeTerminalTraceB

@bric-stripe
Copy link
Collaborator

👋 thanks for the detailed report! Just wanted to ack that we're on it but can't commit to a release when we'll have these all fixed. Will update this issue with more info when we have it.

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

No branches or pull requests

2 participants