What happened?
Description
We’re seeing intermittent production crashes stemming from OneSignalUserDefaults.saveCodeableDataForKey after calling OneSignal.User.addTag/removeTag. The stack trace indicates a C++ exception (N12_GLOBAL__N_122ExceptionObjHolderImplE) that appears whenever tag updates originate from a background thread (e.g., triggered by Superwall events or Kotlin background timers).
This issue happens at different points throughout the app - not just the initialization.
Steps to reproduce?
From a background thread, call:
OneSignal.User.addTag(key: "some_key", value: "some_value")
Allow the SDK to persist tags to user defaults.
Observe crash in OneSignalUserDefaults.saveCodeableDataForKey.
Note that I haven't been able to reproduce this myself... It's only my hypothesis - any help would be appreciated.
Another question is whether I need to call getTags in a particular thread - is it blocking, should I call on Main? etc
What did you expect to happen?
No crashes
OneSignal iOS SDK version
5.2.14
iOS version
18
Specific iOS version
Relevant log output
Code of Conduct