Skip to content

Commit

Permalink
fix: set connectivity state to working immediately after connecting
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
link2xt committed Dec 11, 2023
1 parent 57f4958 commit 02caa76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/imap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
5 changes: 5 additions & 0 deletions src/scheduler/connectivity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 02caa76

Please sign in to comment.