When resyncing with resync_basic and resync_condstore, we would update
the unseen and exists counts for the mailbox without inspecting if the
mailbox was loaded or not. Since a previous commit reset total not yet
seen to 0 when inserting new entries to mail totals, this would lead in
unloaded mailboxes go from having their original unseen counts to having
only the new envelopes in the total.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This was a bad UX artifact from the very first meli versions. There's no
need to keep it around.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Split mailbox related jobs out of JobRequest enum to its own enum since
JobRequest is getting too big to be readable.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add a FromStr implementation so that we can parse a string into a format
value from other places in the code.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add a new WrapResultIntoError trait with method wrap_err() so we can
wrap a result and set its error as a source for a new error and
description, this allows for more descriptive error messages like:
Before:
let mbox_format = parse(some_string)?; <- error msg is "invalid mbox
format value, expected blah blah"
After:
let mbox_format = parse(some_string).wrap_err(|| "Could parse
configuration of account {}", account_name)?; <- error msg is "Could not
parse configuration of account myaccount, Caused by: invalid mbox format
value, expected blah blah"
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Call text() on a RequestBody as soon as it is returned, to avoid
exceeding timeout values, according to isahc documentation.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Sometimes watch futures from backends send refresh events for mailboxes
that have not been fetched yet. That'd trigger fetching them in the
background, which is bad when the mailboxes are big and not wanted by
the user in the first place.
This commit adds a force parameter that specifies whether the loading
must be forced (e.g. when wanting to display the mailbox) or not.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
- Use .Oo/.Oc for inline Optional arguments
- Replace "thread" selection with "entry"
- Spell out alternative arguments in set seen | unseen
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
EmailBodyPart required partId and blobId to be non-null, which is
invalid. Make them Option<_>s instead.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Instead of using the actual maxObjectsInGet batch size when fetching
email, use min(maxObjectsInGet, 500). This makes things not time-out
this easily when the maxObjectsInGet is large (e.g. 4096)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
JMAP code should be using if_in_state wherever possible, to detect
mismatch between current server state and current client state.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
make_address! macro was called with a .take() expression, which was
substituted in the macro more than once hence take() would be called
more than once.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
It appears icloud IMAP servers do not support fetching RFC822 items with
the FETCH command. They reply to the fetch successfully but with the
item missing. To support this clearly non-standard and buggy behavior,
retry one more time by fetching with BODY[] instead if the RFC822 is
missing.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Stable release 1.80.0 has a regression causing compilation errors:
error[E0282]: type annotations needed for `Box<_>`
Pin stable version to 1.79.0, since we don't need anything later than
our MSRV anyway.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
While the timeout value was parsed, it was only used for mutex lock
timeouts and not the http connection.
This commit sets the isahc HTTP connections timeouts using the value, if
provided.
Fixes#422
Resolves: https://git.meli-email.org/meli/meli/issues/422
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Not yet seen behavior is unreliable and leads to false unread counts.
Set it to 0 instead when inserting an existing count.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add consumption of undercurl escape codes without parsing colors, as
there is no support for that in Cell yet.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>