-
Notifications
You must be signed in to change notification settings - Fork 399
fix(rust/gui-client): when the Client starts with a token but no Internet, wait for Internet and then connect #6414
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| controller.ipc_client.set_dns(resolvers).await?; | ||
| }, | ||
| Status::WaitingForNetwork { token } => { | ||
| tracing::debug!("New DNS resolvers, retrying Portal connection..."); |
There 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.
Does this effectively mean we trigger on DNS changes? I suppose on Windows that's pretty reliable, but what's the behavior on Linux?
There 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.
It should be DNS changes and network changes on both OSes
- Linux DNS via D-Bus
Worker::new_dbus(SignalParams { - Linux network via D-Bus
Worker::new_dbus(SignalParams { - Windows DNS via registry listener
let (key_ipv4, key_ipv6) = open_network_registry_keys()?; - Windows network via complicated COM callback https://github.com/firezone/firezone/blob/4ec78f70c220f564e143ed4667543cd58a2baa6b/rust/bin-shared/src/network_changes/windows.rs#L122thing
There 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.
The only alternative I could think of was polling which didn't sound pleasant
Co-authored-by: Jamil <jamilbk@users.noreply.github.com> Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
thomaseizinger
left a comment
There 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 left some ideas on how we can potentially simplify the state machine. Concept ACK though
| /// Firezone is ready to use. | ||
| TunnelReady { resources: Vec<ResourceDescription> }, | ||
| /// Firezone is signing in to the Portal. | ||
| WaitingForPortal { |
There 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.
What do we gain from splitting Connecting into the two Waiting states? connlib will internally reconnect to the portal if it fails whilst we have the tunnel.
Currently, the fact that we resolve the IPs on startup is somewhat of an implementation detail and that may change again. For example, if we end up doing something like #6427, we may resolve them dynamically on startup and thus, creating phoenix-channel will become infallible again.
I would suggest to not let this implementation detail escape the lower layers and just treat the entire time as Connecting.
There 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.
It doesn't affect the behavior, but it's nice to see "Connecting to Portal" in the menu if we're trying to debug something
There 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.
If it is just for debugging, could we also achieve the same with logs? My recommendation would be to not treat the initial boot-up of connlib as two phases. Where it failed in its boot-process shouldn't really matter to the clients.
The above state machine kind of suggests that we would be also showing this when we are internally re-connecting to the portal but we don't. That is completely transparent to the client (until we do #5557).
Closes #6389
I added a retry button since the network change detection is flaky inside Parallels. On bare metal Windows it works fine.