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:
Thomas Eizinger
2025-07-10 15:41:23 +02:00
committed by GitHub
parent 32151b6b0d
commit d4ba045eec

View File

@@ -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(