TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
149 stars 30 forks source link

Do not block calling queue with IO operations of `SignalCache` #101

Open mrackwitz opened 1 year ago

mrackwitz commented 1 year ago

SignalCache used to dispatch synchronously instead of asynchronously to its concurrent queue for the I/O operations of loading the cache and backing up the cache to file system which are typically done on app launch and when the app is sent to background respectively. Given how these functions are called, these would be typically blocking the main thread.

mrackwitz commented 1 year ago

Actually, I just realized that the calling code in SignalManager uses an NSTimer to upload the first batch of events on initialization. So this does introduce a race condition as of now.