jonhoo / rust-imap

IMAP client library for Rust
Apache License 2.0
488 stars 84 forks source link

Expose HIGHESTMODSEQ value in EXPUNGE response #234

Closed bitfehler closed 2 years ago

bitfehler commented 2 years ago

If the QRESYNC extension (RFC 7162) is being used, EXPUNGE responses will return the new highest mod sequence for the mailbox after the expunge operation. Access to this value is quite valuable for caching clients.


This change is Reviewable

bitfehler commented 2 years ago

This one is a bit more involved. I tried to do it in such a way that the API stays essentially the same except for one added field. But I am open for suggestions if you think this would be better handled differently.

codecov[bot] commented 2 years ago

Codecov Report

Merging #234 (b068208) into master (db29117) will decrease coverage by 0.60%. The diff coverage is 96.00%.

Impacted Files Coverage Δ
src/types/deleted.rs 97.22% <91.66%> (ø)
src/client.rs 83.93% <100.00%> (-1.71%) :arrow_down:
src/parse.rs 84.94% <100.00%> (+0.25%) :arrow_up:
src/error.rs 14.28% <0.00%> (-1.30%) :arrow_down:
bitfehler commented 2 years ago

Added non_exhaustive and a test case. Let me know if there is something else you'd like to see in the test. And also if you'd prefer me to pre-squash this into one commit.

jonhoo commented 2 years ago

I do wonder if your CI mail server (Greenmail) supports QRESYNC.. If so, we should be able to write an integration test too, not just a parsing test. But no need for that in this PR.