-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IMAP refactoring #4977
IMAP refactoring #4977
Conversation
We already check if IDLE is supported outside of idle()
It was passed around, but the boolean inside was not used.
// Fetch the watched folder again in case scanning other folder moved messages | ||
// there. | ||
// | ||
// In most cases this will select the watched folder and return because there are | ||
// no new messages. We want to select the watched folder anyway before going IDLE | ||
// there, so this does not take additional protocol round-trip. | ||
if let Err(err) = connection | ||
.fetch_move_delete(ctx, &watch_folder, folder_meaning) | ||
.await | ||
.context("fetch_move_delete after scan_folders") | ||
{ | ||
connection.trigger_reconnect(ctx); | ||
warn!(ctx, "{:#}", err); | ||
return InterruptInfo::new(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@link2xt Did you remove this by accident, or don't we need it anymore?
Don't we need to fetch Inbox again after scanning? (IIUC this is about the Spam folder, because I can't think of another folder from which we would want to move messages to the Inbox).
Or is it just that the added complexity isn't worth the speedup? (IIUC this was about performance, not correctness, because when going IDLE the server would notify us about new messages)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually merged, the last commit caused the tests to break and I removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still on the main branch:
deltachat-core-rust/src/scheduler.rs
Lines 558 to 581 in b86b915
match connection.scan_folders(ctx).await.context("scan_folders") { | |
Err(err) => { | |
// Don't reconnect, if there is a problem with the connection we will realize this when IDLEing | |
// but maybe just one folder can't be selected or something | |
warn!(ctx, "{:#}", err); | |
} | |
Ok(true) => { | |
// Fetch the watched folder again in case scanning other folder moved messages | |
// there. | |
// | |
// In most cases this will select the watched folder and return because there are | |
// no new messages. We want to select the watched folder anyway before going IDLE | |
// there, so this does not take additional protocol round-trip. | |
if let Err(err) = connection | |
.fetch_move_delete(ctx, &watch_folder, folder_meaning) | |
.await | |
.context("fetch_move_delete after scan_folders") | |
{ | |
connection.trigger_reconnect(ctx); | |
warn!(ctx, "{:#}", err); | |
return; | |
} | |
} | |
Ok(false) => {} |
All but the last commit moved out of #4974