mirror of
https://github.com/soywod/himalaya.git
synced 2024-09-29 12:31:13 +00:00
fix missing range when fetch fails, add more logs (#276)
This commit is contained in:
parent
d513afdd16
commit
0172edcb3f
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Blur in list msg screenshot [#181]
|
||||
- Make inbox, sent and drafts folders customizable [#172]
|
||||
- Nix run issue [#272]
|
||||
- Range not displayed when fetch fails [#276]
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -368,3 +369,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
[#229]: https://github.com/soywod/himalaya/issues/229
|
||||
[#272]: https://github.com/soywod/himalaya/issues/272
|
||||
[#273]: https://github.com/soywod/himalaya/issues/273
|
||||
[#276]: https://github.com/soywod/himalaya/issues/276
|
||||
|
|
|
@ -121,12 +121,17 @@ impl<'a> ImapServiceInterface<'a> for ImapService<'a> {
|
|||
}
|
||||
|
||||
fn fetch_envelopes(&mut self, page_size: &usize, page: &usize) -> Result<Envelopes> {
|
||||
debug!("fetch envelopes");
|
||||
debug!("page size: {:?}", page_size);
|
||||
debug!("page: {:?}", page);
|
||||
|
||||
let mbox = self.mbox.to_owned();
|
||||
let last_seq = self
|
||||
.sess()?
|
||||
.select(&mbox.name)
|
||||
.context(format!(r#"cannot select mailbox "{}""#, self.mbox.name))?
|
||||
.exists as i64;
|
||||
debug!("last sequence number: {:?}", last_seq);
|
||||
|
||||
if last_seq == 0 {
|
||||
return Ok(Envelopes::default());
|
||||
|
@ -141,11 +146,12 @@ impl<'a> ImapServiceInterface<'a> for ImapService<'a> {
|
|||
} else {
|
||||
String::from("1:*")
|
||||
};
|
||||
debug!("range: {:?}", range);
|
||||
|
||||
let fetches = self
|
||||
.sess()?
|
||||
.fetch(range, "(ENVELOPE FLAGS INTERNALDATE)")
|
||||
.context(r#"cannot fetch messages within range "{}""#)?;
|
||||
.fetch(&range, "(ENVELOPE FLAGS INTERNALDATE)")
|
||||
.context(format!(r#"cannot fetch messages within range "{}""#, range))?;
|
||||
self._raw_msgs_cache = Some(fetches);
|
||||
Envelopes::try_from(self._raw_msgs_cache.as_ref().unwrap())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue