mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(gui-client): move log about existing session (#9813)
This log is misplaced within the current `try_connect` function because that will also be called when we didn't have Internet while we tried to first connect and then witnessed a network change (in which case the token is cached in the `WaitingForNetwork` session state). Thus, we move the log to the `Connect` msg handler where we shouldn't have any existing session.
This commit is contained in:
@@ -506,6 +506,10 @@ impl<'a> Handler<'a> {
|
||||
ClientMsg::Connect { api_url, token } => {
|
||||
let token = SecretString::new(token);
|
||||
|
||||
if !self.session.is_none() {
|
||||
tracing::debug!(session = ?self.session, "Connecting despite existing session");
|
||||
}
|
||||
|
||||
let result = self.try_connect(&api_url, token.clone());
|
||||
|
||||
if let Some(e) = result
|
||||
@@ -604,10 +608,6 @@ impl<'a> Handler<'a> {
|
||||
fn try_connect(&mut self, api_url: &str, token: SecretString) -> Result<Session> {
|
||||
let started_at = Instant::now();
|
||||
|
||||
if !self.session.is_none() {
|
||||
tracing::warn!(session = ?self.session, "Connecting despite existing session");
|
||||
}
|
||||
|
||||
let device_id = device_id::get_or_create().context("Failed to get-or-create device ID")?;
|
||||
|
||||
let url = LoginUrl::client(
|
||||
|
||||
Reference in New Issue
Block a user