mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
UserDefaults change notifications should always be handled on the main thread. This wasn't the case when PencilKit posted UserDefaults notifications from a background thread during its initialization on iPadOS, causing a Swift 6 MainActor violation crash. Ultimately, the root cause of this issue was not abiding to strict Swift6 concurrency checks by using unsafe code: even when the UserDefaults themselves were `nonisolated(unsafe)` and bypassed the checks, it was not the case for Apple PencilKit framework ultimately initialised in wrong context. Note: There are a few ways to fix, we're settling on Combine pattern as it's used elsewhere in the codebase (e.g. in Store). For other solutions, see: https://stackoverflow.com/questions/74729010/swift-concurrency-notification-callbacks-on-mainactor-objects
FirezoneKit
A description of this package.