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

Make connection tester non-failable on VPN startup #1197

Merged
merged 7 commits into from
Jan 29, 2025

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Jan 28, 2025

Task/Issue URL: https://app.asana.com/0/1207603085593419/1209248230850409/f

iOS PR: duckduckgo/iOS#3885
macOS PR: duckduckgo/macos-browser#3791
What kind of version bump will this require?: Patch

Description

Make sure the Connection Tester isn't being used for rekeying anymore, so we can let it fail silently and not block VPN startup.

Steps to test this PR:

Please refer to the platform-specific PRs.


Internal references:

Software Engineering Expectations
Technical Design Template

@@ -821,7 +791,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
}
#endif
} catch {
self.cancelTunnelWithError(error)
Logger.networkProtection.log("Connection Tester failed to start... will run without it: \(error, privacy: .public)")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most important change.

Comment on lines +142 to +147
do {
try await rekey()
Logger.networkProtectionKeyManagement.log("Rekeying completed.")
} catch {
Logger.networkProtectionKeyManagement.error("Rekeying failed with error: \(error, privacy: .public).")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we surface any errors outside of the tester so that the caller can fire a pixel or take some other action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good observation.

I've thought about this but it's unclear to me right now that this is needed, considering rekey failures are already recorded in the rekey() call. Open to discussing more.

Copy link
Contributor

@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.

Worked as expected in my tests, thanks!

@diegoreymendez diegoreymendez merged commit 20b2408 into main Jan 29, 2025
7 checks passed
@diegoreymendez diegoreymendez deleted the diego/make-connection-tester-non-failable branch January 29, 2025 11:40
diegoreymendez added a commit to duckduckgo/macos-browser that referenced this pull request Jan 29, 2025
Task/Issue URL:
https://app.asana.com/0/1207603085593419/1209248230850409/f

iOS PR: duckduckgo/iOS#3885
BSK PR: duckduckgo/BrowserServicesKit#1197

## Description

Make sure the Connection Tester isn't being used for rekeying anymore,
so we can let it fail silently and not block VPN startup.
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Jan 29, 2025
Task/Issue URL:
https://app.asana.com/0/1207603085593419/1209248230850409/f

macOS PR: duckduckgo/macos-browser#3791
BSK PR: duckduckgo/BrowserServicesKit#1197

## Description

Make sure the Connection Tester isn't being used for rekeying anymore,
so we can let it fail silently and not block VPN startup.
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