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

fix: temporarily disable vpn toggle after toggling off #43

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Feb 12, 2025

There appears to be a race between the VPN service reporting itself as disconnected, and the system extension process exiting. When the VPN is toggled off and on quickly, an error is shown:

image

This PR forces the user to wait 6 seconds before they can toggle the VPN back on.

6 seconds was chosen as on my machine it takes about that long for the app to log that the XPC connection was interrupted after the stopTunnel function returns, and the system informs the app the VPN has been disconnected.

The XPC connection in the network extension is in the global scope, so it makes sense for it's death to imply the process has finally exited.

Potentially related:
image
https://developer.apple.com/forums/thread/84920?answerId=252931022#252931022

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review February 12, 2025 14:43
@ethanndickson ethanndickson force-pushed the ethan/toggle-wait-cleanup branch from 594772b to cfb3dd5 Compare February 12, 2025 14:45
Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

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

I'm not sure if we need this, as when toggling quickly in Tailscale, it leaves me in a disconnected state.
But I can see this being good enough for now.

@ethanndickson
Copy link
Member Author

Yeah, I just thought a light guardrail can't hurt - it also means people are less likely to report it as an issue!

@ethanndickson ethanndickson merged commit b8d110a into main Feb 12, 2025
4 checks passed
@ThomasK33 ThomasK33 deleted the ethan/toggle-wait-cleanup branch February 12, 2025 15:32
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