-
Notifications
You must be signed in to change notification settings - Fork 7
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
Flush sync causes app to hang #18
Comments
it was build this way to ensure the events would be sent when the app goes to background, that’s the only scenario where flushSync is called, but honestly I don’t know if it’s actually necessary. I suppose the OS would give the app to finish any IO tasks |
I am seeing app crashes from what I believe is this same issue. The app will hang on launch and will crash after about 30 seconds. I am only seeing this hang and crash when the app has no network connection. I do NOT see the hang and crash when running in the simulator only on real devices. Devices: iPhone 14 Pro & iPad mini 6th gen I am seeing the following in the crash logs from the real device. This is what make me think this is the same issue, it references semaphore_wait_trap and AptabaseClient.flushSync
On the simulator where I do NOT see the crash I get the following errors in the console log repeating forever:
|
I just tested the code changes in PR #19 and it seems to fix the crash I mentioned above. Could that be merged into the main repo soon? |
Hi @Claeysson @dalenjohnson - the 0.3.9 version is up & running, please let us know if everything works as expected, thanks! |
Performance issue
Sentry.io reports app hanging for over 2000ms when flushSync() is triggered.
This code in aptabseClient.swift seems to be called on the main thread, and
semaphore.wait()
locks the main thread.Potential fix
I'm not quite sure why
semaphore.wait()
is used here. My best guess is that I will prevent a new flushSync if the latest hasn't finished executing. I've added a timer pause variable to mimic the wait but with out locking the main thread.The text was updated successfully, but these errors were encountered: