aptabase-swift icon indicating copy to clipboard operation
aptabase-swift copied to clipboard

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

Open Claeysson opened this issue 1 year ago • 1 comments

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

Claeysson avatar Feb 29 '24 09:02 Claeysson

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?

goenning avatar Mar 01 '24 18:03 goenning

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 avatar Jun 14 '24 17:06 cristipufu

We will document a solution for this

cristipufu avatar Jun 14 '24 17:06 cristipufu