Skip to content

fix(imap): record HIGHESTMODSEQ from a STATUS response - #291

Open
hobleyd wants to merge 1 commit into
Enough-Software:mainfrom
hobleyd:fix/imap-status-highestmodseq
Open

hobleyd wants to merge 1 commit into
Enough-Software:mainfrom
hobleyd:fix/imap-status-highestmodseq

Conversation

@hobleyd

@hobleyd hobleyd commented Sep 22, 2026

Copy link
Copy Markdown

Problem

StatusParser had no case for HIGHESTMODSEQ. A CONDSTORE server that answers STATUS ... (HIGHESTMODSEQ n) (RFC 7162 section 3.1.6), whether asked for it via ReturnOption.status(['HIGHESTMODSEQ']) or volunteering it, hit the default: branch: the value was printed as unexpected and discarded. Mailbox.highestModSequence was only ever populated by SELECT, so a client using STATUS to decide whether a mailbox needs a sync could not do so.

Fix

Add the HIGHESTMODSEQ case and store it in box.highestModSequence.

Tests

New test in status_parser_test.dart. Fails against main.

StatusParser had no case for HIGHESTMODSEQ, so a CONDSTORE server that
answers `STATUS ... (HIGHESTMODSEQ n)` (RFC 7162 section 3.1.6), whether
asked for it or volunteering it, hit the default branch and the value was
printed as unexpected rather than stored. Mailbox already has a
highestModSequence field, populated by SELECT; STATUS now fills it too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants