* Make some managers concurrency-safe
- IntentsManager: @MainActor, non-shared, continuation
- SSIDReader: @MainActor, continuation
- Reviewer: main queue, non-shared
* Review wrong use of Concurrency framework
There were background thread calls e.g. in VPNToggle, because
ProfileManager was used inside a VPNManager async call.
Annotate @MainActor wherever a Task involves UI.
* Make main managers MainActor
* Apply MainActor to Mac menus
* [ci skip] Update CHANGELOG
* Set MainActor consistently on Mac menu view models
Move all persisted state out of AppManager to where it really
belongs. To do that, inject a shared KeyValueStore object into
managers that need to persist part of their state in a strongly
typed manner.
Below are persisted states:
- PersistenceManager
- persistenceAuthor
- ProfileManager
- activeProfileId
- UpgradeManager (formerly AppManager)
- didMigrateToV2 (migrate former value)
- VPNManager
- tunnelLogFormat
- masksPrivateData
A similar approach is used for app-specific preferences, by using
a strongly typed enum (AppPreference) together with SwiftUI
@AppStorage property wrapper.
Worth moving logging logic into a specific LogManager.
Finally, drop any former view dependency on AppManager, as states
are now accessed through specific managers.
- Update TunnelKit
- Receive TunnelKit notifications on main queue
- Bind VPN toggle to VPNManager directly (implicit animations)
- Update state on VPN didFail
- Set isEnabled = false after uninstalling VPN (not notified)