Remove confusing log "ignoring unsolicited response Recent(…)" (#3934)

It doesn't seem to add value and gives the impression that something
went wrong.
This commit is contained in:
Hocuri
2023-04-13 18:27:25 +02:00
committed by GitHub
parent 28fd27476f
commit d4f2507288
2 changed files with 23 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
- Compress `mime_headers` column with HTML emails stored in database - Compress `mime_headers` column with HTML emails stored in database
- Strip BIDI characters in system messages, files, group names and contact names #3479 - Strip BIDI characters in system messages, files, group names and contact names #3479
- maybe_add_time_based_warnings(): Use release date instead of the provider DB update one - maybe_add_time_based_warnings(): Use release date instead of the provider DB update one
- Remove confusing log line "ignoring unsolicited response Recent(…)" #3934
- Cleanly terminate deltachat-rpc-server. - Cleanly terminate deltachat-rpc-server.
Also terminate on ctrl-c. Also terminate on ctrl-c.
- Refactorings #4317 - Refactorings #4317

View File

@@ -1740,17 +1740,37 @@ impl Session {
/// If this returns `true`, this means that new emails arrived and you should /// If this returns `true`, this means that new emails arrived and you should
/// fetch again, even if you just fetched. /// fetch again, even if you just fetched.
fn server_sent_unsolicited_exists(&self, context: &Context) -> Result<bool> { fn server_sent_unsolicited_exists(&self, context: &Context) -> Result<bool> {
use async_imap::imap_proto::Response;
use async_imap::imap_proto::ResponseCode;
use UnsolicitedResponse::*;
let mut unsolicited_exists = false; let mut unsolicited_exists = false;
while let Ok(response) = self.unsolicited_responses.try_recv() { while let Ok(response) = self.unsolicited_responses.try_recv() {
match response { match response {
UnsolicitedResponse::Exists(_) => { Exists(_) => {
info!( info!(
context, context,
"Need to fetch again, got unsolicited EXISTS {:?}", response "Need to fetch again, got unsolicited EXISTS {:?}", response
); );
unsolicited_exists = true; unsolicited_exists = true;
} }
_ => info!(context, "ignoring unsolicited response {:?}", response),
// We are not interested in the following responses and they are are
// sent quite frequently, so, we ignore them without logging them
Expunge(_) | Recent(_) => {}
Other(response_data)
if matches!(
response_data.parsed(),
Response::Fetch { .. }
| Response::Done {
code: Some(ResponseCode::CopyUid(_, _, _)),
..
}
) => {}
_ => {
info!(context, "got unsolicited response {:?}", response)
}
} }
} }
Ok(unsolicited_exists) Ok(unsolicited_exists)