Describe the bug
When a new remote configuration with a version higher than the current default configuration is available, the SDK crashes on app start.
Our investigation showed that the bug lies in the combination of having a default configuration with a loggerDelegate and fetching a newer remote config. The crash happens when the SDK tries to write the configuration to the cache.
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException',
reason: 'This decoder will only decode classes that adopt NSSecureCoding.
Class '[Our LoggerDelegate class]' does not adopt it.'.
To Reproduce
Initialize the tracker with a default config that has a loggerDelegate set and with a defaultVersion of X.
Have a remote configuration with version X+1.
Run Snowplow.setup(...)
Use the SDK 5.3 or higher
Expected behavior
No crash - The SDK should not crash our app but just log an error, caching is no crucial functionality.
After carefully looking at the problem we would expect the logger to not be part of a default configuration but to be something we can put on any tracker at any time. Or just put it somewhere where you don't try to cache it.
Our logger does contain classes that are initialized at runtime, there is no way this class could be serialized.
Device information (please complete the following information):
Device: any iPhone
OS: iOS 15 - iOS 18
Version since SDK tracker version 5.3+
Additional context
We backtraced the bug to be added in v5.3 of the iOS tracker library. We did not find it earlier because we never needed to upgrade our remote configuration until this week.
(I'll add a detailed stacktrace in a support ticket and give more information of the impact on our app there)
Hi @JasminFrei, thank you for reporting this bug, we will look into this shortly. Please do share the stack trace with us in the support ticket, that would be helpful as well.
Describe the bug When a new remote configuration with a version higher than the current default configuration is available, the SDK crashes on app start. Our investigation showed that the bug lies in the combination of having a default configuration with a
loggerDelegate
and fetching a newer remote config. The crash happens when the SDK tries to write the configuration to the cache.To Reproduce
loggerDelegate
set and with a defaultVersion of X.Snowplow.setup(...)
Expected behavior
Device information (please complete the following information):
Additional context We backtraced the bug to be added in v5.3 of the iOS tracker library. We did not find it earlier because we never needed to upgrade our remote configuration until this week. (I'll add a detailed stacktrace in a support ticket and give more information of the impact on our app there)