App disconnects VPN on launch otherwise, because active
profile is still nil. Where was the regression introduced?
Also .dropFirst() to skip initial values, but keep in mind that
if VPN is connected and active profile was not properly persisted,
the app will show the VPN as disabled.
When setting duplicate as current, batch save original profile and
duplicate in a single call via profilesToSave. This is to avoid a
double call to willUpdateProfiles() when saving Core Data context.
In order to set current profile to one that has not been persisted
yet (the duplicate), we need to resort to a pendingProfiles map
where to look the duplicate up when setting currentProfileId.
Either way, iOS 14 cannot handle updating a "hot" change in a
presented NavigationLink. Changing currentProfileId binding while
in ProfileView messes up navigation completely (multiple push and
pop events). Avoid.
- Do the profile loading inside the model
- Allow setting current profile to a transient profile
- Check .placeholder before saving current profile
XXX: avoid loading active profile on iPad portrait.
Notifications deemed not relevant because currentBundleIdentifier
not set unless connect/reinstate.
Assume initial relevant identifier to be the first notified.
See 7ba41a0e73
Flashing on activation was caused by VPNManager.disable() in
ProfileView+VPN, because by setting lastError to nil it would
notify a change to ProfileRow (via VPNStateView) during the
profile row activation animation. That caused the flicker.
Instead, disable VPN first, then start the animation.
Anyway, avoid clearing a nil lastError.
ProfileView is not interested in changes in other profiles
notified by ProfileManager. Set isLoading inside
ObservableObject for observable to be self-contained.
Loses observation of profile deletion, but dismiss on removal is
actually handled by OrganizerView, not ProfileView.
Also drop unused presentationMode.
Make action sync, but internally async (makeProfileReady). If not
doing so, UI on launch will not be able to show active profile
immediately. WelcomeView would appear for a moment.
Observe isReloadingCurrentProfile.
See 2b1efb8fec
- 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)
- Drop unused AppManager from OrganizerView
- Do not notify ProfileManager subscribers on activeProfileId
Saved active profile is already notified by:
- Core Data
- AppManager
Otherwise:
- Switch from former active profile A to B
- Connect to now active profile B
- Kill app
- Reopen app
- App shows connected to profile A
Because active profile was not saved immediately on switch.
Unnecessary now to also save it on background persist().
- Drop macOS target from Package.swift
- Drop @available attributes
- UI idiom
- Intents API
- Swipe actions in ProviderLocationView
- Review os(iOS)
- DebugLog, append idiom to tell Mac from iPad
- Drop redundant canImport
Enum seems to be mapped correctly. Make sure matching works on
real device though.
Also noticed that @available on iOS implies availability on
Catalyst as well, making it ineffective e.g. in this case, where
mobile and ethernet network matching should be only available on
iOS and macOS respectively.
Swipe to delete. Address a couple things on iPad though:
1. Also check provider availability before showing view
fatalError hit on iPad when navigating from a ready provider
profile to a non-ready one. Similar to when navigating between
different VPN protocols.
2. Suppress assertion on deleted profile
Deleting current profile via swipe seems to re-render a new
NavigationLink with the deleted profile, which results in
loading a deleted profile and hitting the assertion. Not sure if
this is a programming error or a glitch in ForEach.
- Group DNS "Enabled" and protocol into configuration
- Make DNS servers / search domains optional
- Make proxy bypass domains optional
Also refine a comment about future on-demand.