What are the versions of any relevant development tools you are using?
Xcode 12.5.1, Swift Package Manager
Report
What unexpected behaviour are you seeing?
Crashes in -[UAPreferenceDataStore setObject:forKey:].
What is the expected behaviour?
That it does not crash.
What are the steps to reproduce the unexpected behaviour?
Reproducing this crash is relatively hard, you have to observe the standard UserDefaults. Then while airship is writing into the defaults, the observer needs to be deallocated at the same time.
Which would practically mean that it is an apple/UserDefaults issue that needs to be worked around. We will try to work around it in our key value observations as well, but I think you could mitigate this issue too by using an extra UserDefaults suite for airship (better solution) or dispatching your UserDefaults calls onto the main thread.
Preliminary Info
What Airship dependencies are you using?
Airship 14.5.0
What are the versions of any relevant development tools you are using?
Xcode 12.5.1, Swift Package Manager
Report
What unexpected behaviour are you seeing?
Crashes in -[UAPreferenceDataStore setObject:forKey:].
What is the expected behaviour?
That it does not crash.
What are the steps to reproduce the unexpected behaviour?
Reproducing this crash is relatively hard, you have to observe the standard UserDefaults. Then while airship is writing into the defaults, the observer needs to be deallocated at the same time.
Do you have logging for the issue?
https://gist.github.com/iwt-dahlborn/fcfb9a70c3d6b3109128a56d7b2f529b
I am pretty sure that this crash is the same issue described here: https://github.com/google/google-toolbox-for-mac/issues/238
Which would practically mean that it is an apple/UserDefaults issue that needs to be worked around. We will try to work around it in our key value observations as well, but I think you could mitigate this issue too by using an extra UserDefaults suite for airship (better solution) or dispatching your UserDefaults calls onto the main thread.