-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes some VPN uninstallation issues #2820
Conversation
private func subscribeToConfigurationChanges() { | ||
notificationCenter.publisher(for: .NEVPNConfigurationChange) | ||
.receive(on: DispatchQueue.main) | ||
.sink { _ in | ||
Task { @MainActor in | ||
guard let manager = await self.manager else { | ||
return | ||
} | ||
|
||
do { | ||
try await manager.loadFromPreferences() | ||
|
||
if manager.connection.status == .invalid { | ||
self.clearInternalManager() | ||
} | ||
} catch { | ||
self.clearInternalManager() | ||
} | ||
} | ||
} | ||
.store(in: &cancellables) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the configuration changes we load it to make sure we have the latest. Or we clear it if it's become invalid.
guard tunnelManager.connection.status != .invalid else { | ||
// An invalid connection status means the VPN isn't really configured | ||
// so we don't want to save changed because that would re-create the VPN | ||
// configuration. | ||
clearInternalManager() | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the gist of the fix for the issues I was able to reproduce. The tunnel manager's connection becomes invalid if the configuration isn't saved.
In that case we don't really want to save changes, cos that'd prompt the user to create the configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this before and after on main
and then this branch and confirmed this fixed the issue perfectly. I'm able to install/uninstall repeatedly with no issues, including when the VPN is connected/disconnected.
We should bring this change to the release branch, feel free to retarget it and merge.
Thanks for spotting that @samsymons - this was actually branched off the release branch but I forgot to change the target here, so you saved me some trouble there :) |
* main: Bump version to 1.90.0 (196) Revert "Add PIPAgent entitlement (#2821)" (#2823) Bump version to 1.90.0 (195) Bump version to 1.90.0 (194) Add PIPAgent entitlement (#2821) Fixes some VPN uninstallation issues (#2820) Bump version to 1.90.0 (193) Remove autofill survey (#2819) Remove autofill survey (#2819) Bump version to 1.90.0 (192) Set marketing version to 1.90.0 Update embedded files Privacy Pro survey support (#2816)
# By Elle Sullivan (10) and others # Via GitHub (6) and others * main: (42 commits) Update autoconsent to v10.9.0 (#2822) Bump version to 1.90.0 (196) Revert "Add PIPAgent entitlement (#2821)" (#2823) Bump version to 1.90.0 (195) Bump version to 1.90.0 (194) Add PIPAgent entitlement (#2821) Fixes some VPN uninstallation issues (#2820) Bump version to 1.90.0 (193) Remove autofill survey (#2819) Remove autofill survey (#2819) Bump version to 1.90.0 (192) Set marketing version to 1.90.0 Update embedded files Privacy Pro survey support (#2816) Update PeopleWhiz Broker Files to use hash id (#2814) Update BSK due to iOS changes. (#2776) Scroll address bar to caret when using arrows (#2799) Privacy Pro macOS quick follow ups (#2813) BSK bump for iOS RMF updates (#2798) Autofill engagement KPIs for pixel reporting (#2806) ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
* main: Add optional "multiple" property to PageElement (#2827) Update BSK for iOS RMF changes (#2831) Bump version to 1.91.0 (197) Set marketing version to 1.91.0 Update embedded files DBP: Enable DBP Operations to Run When Device is Locked (#2797) Update autoconsent to v10.9.0 (#2822) Bump version to 1.90.0 (196) Revert "Add PIPAgent entitlement (#2821)" (#2823) Bump version to 1.90.0 (195) Bump version to 1.90.0 (194) Add PIPAgent entitlement (#2821) Fixes some VPN uninstallation issues (#2820) Bump version to 1.90.0 (193) Remove autofill survey (#2819)
Task/Issue URL: https://app.asana.com/0/1206580121312550/1207431594119528/f
Description
Fixes some VPN uninstallation issues in v1.90.0.
Testing
Try installing and uninstalling the VPN and make sure the uninstallation works.
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation