- Notifications
You must be signed in to change notification settings - Fork3
fix: temporarily disable vpn toggle after toggling off#43
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
594772b
tocfb3dd5
CompareThere 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'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.
Yeah, I just thought a light guardrail can't hurt - it also means people are less likely to report it as an issue! |
b8d110a
intomainUh oh!
There was an error while loading.Please reload this page.
Depends oncoder/coder#16598.Reverts#43.Whilst everything seems to recover okay tailnet wise when waking from sleep currently, the tunnel will still miss workspace/peer updates during the sleep, causing the workspace state in the UI to be out of sync with reality. To handle this, we'll teardown the tunnel on sleep, and bring it back up on wake.Fixing the issue in `coder/coder` also revealed that the error encountered when toggling the VPN on and off quickly was another symptom, and so this change reverts the code that prevents toggling the VPN on and off quickly, as it now works flawlessly.
Uh oh!
There was an error while loading.Please reload this page.
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:
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:

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