From 55ada1cd89baf1130b7a1bbd09708626a3156bc5 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 11 Nov 2019 10:16:02 +0100 Subject: [PATCH] some more logging --- python/tests/test_account.py | 6 +++++- src/imap.rs | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 750c16414..f6ba6da9b 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -427,15 +427,19 @@ class TestOnlineAccount: assert self_addr not in ev[2] ev = ac1._evlogger.get_matching("DC_EVENT_DELETED_BLOB_FILE") - def test_mvbox_sentbox_threads(self, acfactory): + def test_mvbox_sentbox_threads(self, acfactory, lp): ac1 = acfactory.get_online_configuring_account(mvbox=True, sentbox=True) ac2 = acfactory.get_online_configuring_account() wait_configuration_progress(ac2, 1000) wait_configuration_progress(ac1, 1000) + lp.sec("configuration completed for both accounts") chat = self.get_chat(ac1, ac2) + lp.sec("ac1: send text to chat with ac2") chat.send_text("message1") + lp.sec("ac2: wait for incoming message") ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED") assert ev[2] > const.DC_CHAT_ID_LAST_SPECIAL + lp.sec("message arrived, test ends") def test_move_works(self, acfactory): ac1 = acfactory.get_online_configuring_account() diff --git a/src/imap.rs b/src/imap.rs index 64db44093..454674cbe 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -398,6 +398,7 @@ impl Imap { async fn select_folder>(&self, context: &Context, folder: Option) -> usize { if self.session.lock().await.is_none() { + info!(context, "select_folder detects there is a shutdown ongoing"); let mut cfg = self.config.write().await; cfg.selected_folder = None; cfg.selected_folder_needs_expunge = false; @@ -748,13 +749,16 @@ impl Imap { pub fn idle(&self, context: &Context) { task::block_on(async move { + info!(context, "imap.idle entered"); if !self.config.read().await.can_idle { self.fake_idle(context).await; return; } + info!(context, "setting up handle if needed"); self.setup_handle_if_needed(context); + info!(context, "select watch folder"); let watch_folder = self.config.read().await.watch_folder.clone(); if self.select_folder(context, watch_folder.as_ref()).await == 0 { warn!(context, "IMAP-IDLE not setup."); @@ -763,6 +767,7 @@ impl Imap { return; } + info!(context, "starting to enter idle loop"); let session = self.session.lock().await.take(); let timeout = Duration::from_secs(23 * 60); if let Some(session) = session {