aptabase / aptabase-swift

Swift SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps
https://aptabase.com
MIT License
23 stars 8 forks source link

Removed semaphore.wait() and introduced a timer pause boolean. #19

Closed Claeysson closed 4 months ago

Claeysson commented 8 months ago

Potential fix for app hang caused by flushSync() in aptabaseClient.swift.

Removed semaphore.wait() and added a variable to pause the timer execution if flush isn't done executing.

closes #18

goenning commented 8 months ago

In this case there flushSync is no longer synonymous because it doesn’t wait for it to complete, maybe we could test just calling “flush” instead of “flushAsync” when the app goes to background or is closed?

cristipufu commented 4 months ago

I think we shouldn't block the app until the http call completes (unpredictable response time).

Maybe the sdk consumer can decide whether to call flush on applicationDidEnterBackground if needed (https://developers.google.com/analytics/devguides/collection/ios/v3/dispatch#override-applicationDidEnterBackground)

cristipufu commented 4 months ago

We will document a solution for this