From 2f29c56a364cbeac225b299b8eca6ed37993fba0 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 14 Jan 2024 02:43:24 +0000 Subject: [PATCH] fix: do not log error if watched folder is not configured This may happen if Sent folder does not exist but configuration option to watch it is enabled. --- python/tests/test_1_online.py | 2 +- src/scheduler.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/tests/test_1_online.py b/python/tests/test_1_online.py index d79b2b8a1..ac0fde685 100644 --- a/python/tests/test_1_online.py +++ b/python/tests/test_1_online.py @@ -381,7 +381,7 @@ def test_webxdc_download_on_demand(acfactory, data, lp): assert msgs_changed_event.data1 == msg2.chat.id assert msgs_changed_event.data2 == 0 -@pytest.mark.xfail(reason="Test server has no sentbox folder") + def test_mvbox_sentbox_threads(acfactory, lp): lp.sec("ac1: start with mvbox thread") ac1 = acfactory.new_online_configuring_account(mvbox_move=True, sentbox_watch=True) diff --git a/src/scheduler.rs b/src/scheduler.rs index 872524719..9a8b651ea 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -520,7 +520,10 @@ async fn fetch_idle(ctx: &Context, connection: &mut Imap, folder_meaning: Folder let (folder_config, watch_folder) = match convert_folder_meaning(ctx, folder_meaning).await { Ok(meaning) => meaning, Err(error) => { - error!(ctx, "Error converting IMAP Folder name: {:?}", error); + // Warning instead of error because the folder may not be configured. + // For example, this happens if the server does not have Sent folder + // but watching Sent folder is enabled. + warn!(ctx, "Error converting IMAP Folder name: {:?}", error); connection.connectivity.set_not_configured(ctx).await; connection .fake_idle(ctx, None, FolderMeaning::Unknown)