From 02caa76375b2ce7a8cd15817e2de24697a7aee4e Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 11 Dec 2023 22:37:03 +0000 Subject: [PATCH] fix: set connectivity state to working immediately after connecting "Connected" state actually means that that connection is there, but Delta Chat currently has no use for it. `all_work_done()` retruns true for Connected state and false for Working state. We do not want all_work_done() to return true immediately after calling start_io(), but only when connection goes idle. --- src/imap.rs | 2 +- src/scheduler/connectivity.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/imap.rs b/src/imap.rs index 526224ef9f..3e622c7ea7 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -404,7 +404,7 @@ impl Imap { "IMAP-LOGIN as {}", self.config.lp.user ))); - self.connectivity.set_connected(context).await; + self.connectivity.set_working(context).await; info!(context, "Successfully logged into IMAP server"); Ok(()) } diff --git a/src/scheduler/connectivity.rs b/src/scheduler/connectivity.rs index 104cdd5844..7f2464ba0e 100644 --- a/src/scheduler/connectivity.rs +++ b/src/scheduler/connectivity.rs @@ -33,8 +33,13 @@ enum DetailedConnectivity { #[default] Uninitialized, Connecting, + + /// State set immediately after connecting. + /// This means connection is established, but connection is not idle yet. Working, InterruptingIdle, + + /// Connection is established and is idle. Connected, /// The folder was configured not to be watched or configured_*_folder is not set