Compare commits

...

3 Commits

Author SHA1 Message Date
Hocuri
695e22ca71 fix it, maybe 2026-03-23 16:11:09 +01:00
Hocuri
67851e64ba 4 more debug statements 2026-03-23 16:04:50 +01:00
holger krekel
88d31d6b30 add more debugging 2026-03-23 16:03:21 +01:00
3 changed files with 15 additions and 4 deletions

View File

@@ -515,6 +515,7 @@ impl Imap {
watch_folder: &str,
folder_meaning: FolderMeaning,
) -> Result<()> {
info!(context, "dbg 2");
if !context.sql.is_open().await {
// probably shutdown
bail!("IMAP operation attempted while it is torn down");
@@ -551,6 +552,7 @@ impl Imap {
folder: &str,
folder_meaning: FolderMeaning,
) -> Result<bool> {
info!(context, "dbg 3");
if should_ignore_folder(context, folder, folder_meaning).await? {
info!(context, "Not fetching from {folder:?}.");
session.new_mail = false;
@@ -561,16 +563,19 @@ impl Imap {
.select_with_uidvalidity(context, folder)
.await
.with_context(|| format!("Failed to select folder {folder:?}"))?;
if !folder_exists {
return Ok(false);
}
if !session.new_mail {
info!(context, "No new emails in folder {folder:?}.");
return Ok(false);
}
info!(context, "Setting new_mail to False");
session.new_mail = false;
if !folder_exists {
info!(context, "dbg 4");
return Ok(false);
}
let mut read_cnt = 0;
loop {
let (n, fetch_more) = self
@@ -1237,6 +1242,7 @@ impl Session {
// have been modified while our request was in progress.
// We may or may not have these new flags as a part of the response,
// so better skip next IDLE and do another round of flag synchronization.
info!(context, "got unsolicited fetch in folder");
self.new_mail = true;
}

View File

@@ -30,13 +30,17 @@ impl Session {
self.select_with_uidvalidity(context, folder).await?;
if self.drain_unsolicited_responses(context)? {
info!(
context,
"Setting new_mail to True"
);
self.new_mail = true;
}
if self.new_mail {
info!(
context,
"Skipping IDLE in {folder:?} because there may be new mail."
"YES YES YES Skipping IDLE in {folder:?} because there may be new mail."
);
return Ok(self);
}

View File

@@ -567,6 +567,7 @@ async fn fetch_idle(
)
.await
.context("idle")?;
info!(ctx, "dbg 1");
Ok(session)
}