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

@@ -1740,17 +1740,37 @@ impl Session {
/// If this returns `true`, this means that new emails arrived and you should
/// fetch again, even if you just fetched.
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;
while let Ok(response) = self.unsolicited_responses.try_recv() {
match response {
UnsolicitedResponse::Exists(_) => {
Exists(_) => {
info!(
context,
"Need to fetch again, got unsolicited EXISTS {:?}", response
);
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)