Make scan_folders work when inbox is not watched (#2446)

When watch_inbox was off, scan_folders failed and a toast "IMAP operation attempted while it is torn down" was shown.

--

The problem was:

When inbox_watch is off, scan_folders() is called at 244260a978/src/scheduler.rs (L107) but connect_configured() is not called before.



* Add test

* Don't only setup handle, but connect_configured() in scan_folders()
This commit is contained in:
Hocuri
2021-05-16 22:18:38 +02:00
committed by GitHub
parent 09280508bc
commit a9f5077cf9
2 changed files with 16 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ impl Imap {
}
info!(context, "Starting full folder scan");
self.setup_handle(context).await?;
self.connect_configured(context).await?;
let session = self.session.as_mut();
let session = session.context("scan_folders(): IMAP No Connection established")?;
let folders: Vec<_> = session.list(Some(""), Some("*")).await?.collect().await;