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.
This commit is contained in:
link2xt
2024-01-14 02:43:24 +00:00
committed by bjoern
parent de86b8a96e
commit 2f29c56a36
2 changed files with 5 additions and 2 deletions

View File

@@ -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.data1 == msg2.chat.id
assert msgs_changed_event.data2 == 0 assert msgs_changed_event.data2 == 0
@pytest.mark.xfail(reason="Test server has no sentbox folder")
def test_mvbox_sentbox_threads(acfactory, lp): def test_mvbox_sentbox_threads(acfactory, lp):
lp.sec("ac1: start with mvbox thread") lp.sec("ac1: start with mvbox thread")
ac1 = acfactory.new_online_configuring_account(mvbox_move=True, sentbox_watch=True) ac1 = acfactory.new_online_configuring_account(mvbox_move=True, sentbox_watch=True)

View File

@@ -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 { let (folder_config, watch_folder) = match convert_folder_meaning(ctx, folder_meaning).await {
Ok(meaning) => meaning, Ok(meaning) => meaning,
Err(error) => { 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.connectivity.set_not_configured(ctx).await;
connection connection
.fake_idle(ctx, None, FolderMeaning::Unknown) .fake_idle(ctx, None, FolderMeaning::Unknown)