Skip to content
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

Merged
merged 1 commit into from
May 30, 2024

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented May 29, 2024

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

@diegoreymendez diegoreymendez self-assigned this May 29, 2024
@diegoreymendez diegoreymendez requested a review from samsymons May 29, 2024 11:30
@diegoreymendez diegoreymendez marked this pull request as ready for review May 29, 2024 11:30
@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label May 29, 2024
@diegoreymendez diegoreymendez removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label May 29, 2024
Comment on lines +223 to +244
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)
}
Copy link
Contributor Author

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.

Comment on lines +730 to +736
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
}
Copy link
Contributor Author

@diegoreymendez diegoreymendez May 29, 2024

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.

Copy link
Collaborator

@samsymons samsymons left a 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.

@diegoreymendez diegoreymendez changed the base branch from main to release/1.90.0 May 30, 2024 09:10
@diegoreymendez
Copy link
Contributor Author

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 :)

@diegoreymendez diegoreymendez merged commit 3db1af0 into release/1.90.0 May 30, 2024
40 of 43 checks passed
@diegoreymendez diegoreymendez deleted the diego/fix-vpn-uninstall branch May 30, 2024 09:15
samsymons added a commit that referenced this pull request May 31, 2024
* 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)
samsymons added a commit that referenced this pull request Jun 1, 2024
# 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
samsymons added a commit that referenced this pull request Jun 4, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants