Closed Shakarang closed 1 year ago
Hi @Shakarang, thanks for the report, we'll take a look. A couple of questions: were you able to reproduce this locally, or is this just rolled up from Sentry? (If locally, what percentage of SDK inits hung?)
Hey @cbowns, yes I'm able to see the hang locally, it happens during the init. I've attached the screenshot of the Time Profiler.
Hey! We're getting reports now that it also happens on iOS, both 15 and 16.
@Shakarang thanks for the trace info and iOS version info.
Broadly, this is an as-designed synchronous call in the SDK: we need it to guarantee data consistency across objects as we write+read to/from flash.
However, the duration you're seeing is longer than we've seen in testing. Do you have any additional information about the distribution of duration across device types + OSes?
(One more thing: this is a pretty quick call stack and a lot shorter than the hangs Sentry usually identifies (iirc, > 2s by default). Do you have their timeout set to something custom?)
Thanks for the feedback @cbowns.
Would it be possible to make the initialisation work in another thread instead of relying on the main one?
I don't see any obvious pattern in the device distribution. And for the time, Sentry only reports that the app was stuck for +2s, not more.
No, we didn't set any specific timeout in Sentry.
Also, Sentry reports a lot of other hangs (that have less impacted users though)
Hi @Shakarang,
Would it be possible to make the initialisation work in another thread instead of relying on the main one?
The Swift SDK (and the precursor AppboyKit SDK) require to be initialized on the main thread to ensure expected functionality of the SDK and data consistency, etc. We have not heard of issues from our other clients around the app hanging for 2+ seconds in the past during a vanilla integration, so we'd like to know additional information around your setup.
Can you contact support@braze.com and attach this Github thread with more information around your setup:
Thanks!
Hi @Shakarang, we have just released the SDK 6.2.0 which removes a system call we believe was responsible for the SDK hanging on macOS (iCloud backup exclusion).
I'm closing the issue, feel free to re-open it if the issue persist after upgrading.
Thanks,
Hey @lowip,
Thanks for the info and sorry for not following up, I was off for the last weeks. I'll let you know if we still have the issue.
Thanks!
Platform
Mac Catalyst
Platform Version
macOS 12 / macOS 13
Braze SDK Version
5.13.0
Xcode Version
14.3
Computer Processor
Intel
Repro Rate
100%
Steps To Reproduce
Example:
Expected Behavior
No App Hang is reported.
Actual Incorrect Behavior
The Application Hangs on macOS devices
Verbose Logs
Additional Information
Hello,
Our application uses the Braze SDK on iOS and Mac Catalyst. We use sentry.io to report crashes/hang and it has detected a App Hang when starting the SDK. There are only reports of this happening on macOS, nothing on iOS. It happens on both Intel and M1 machines.
We use the
inAppMessagePresenter
feature and the SDK initialisation cannot be moved to a background thread to mitigate it on our side.In the verbose logs is attached the report sent by Sentry.
The SDK is initialised at the start of the application.
Regards,