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

Further improve device wake & sleep handling #88

Open
ethanndickson opened this issue Mar 4, 2025 · 0 comments
Open

Further improve device wake & sleep handling #88

ethanndickson opened this issue Mar 4, 2025 · 0 comments

Comments

@ethanndickson
Copy link
Member

ethanndickson commented Mar 4, 2025

For context, Coder Desktop's networking starts & stops itself on device wake & sleep, respectively. Both of these events can be sent by the operating system even when the device lid is closed, or when the screen is completely off, in order to check for network events.

There's two problems with this right now:

  1. The procedure on wake sets the system VPN state to reasserting. The operating system does not wait for a reasserting state to end before it calls sleep.
    We currently do not handle any form of queuing for these events, so if the tunnel is still starting up, the sleep call is effectively ignored.
    This makes it possible for the VPN to be enabled when the last call from the operating system was sleep. It's not super clear what issues this causes, if any, but it's something we should fix.

  2. A new coder-vpn.dylib can be downloaded, even if the user is not present to enter their password & un-quarantine it.
    If this happens, the networking functionality will fail with an error, and the developer will have to toggle it in settings once again.
    Ideally, this shouldn't happen. Users should be able to wake their laptop from sleep, and CoderVPN should be in (or entering) the same state they left it.
    We should either find a way to recover from this error (by using the previously downloaded coder-vpn.dylib), or simply not start the download if the tunnel was started by a call to wake, where the user might not be present.

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

No branches or pull requests

1 participant