Do not advance HighestModSeq after failed CONDSTORE search #10

Closed
opened 2026-05-11 18:52:27 +02:00 by heiko · 4 comments
Owner

Problem

cmd/xr-invoiced/main.go advances st.HighestModSeq even when SearchSinceModSeq fails.

Reference: cmd/xr-invoiced/main.go:148 and cmd/xr-invoiced/main.go:167.

On CONDSTORE servers this can permanently skip changed messages: the search error is logged, but the state is still moved to the mailbox's newer HighestModSeq.

Expected

Keep the old HighestModSeq unless the modseq search succeeds and changed UIDs have been processed.

Suggested fix

Only assign st.HighestModSeq = mailboxInfo.HighestModSeq in the successful search path, ideally after processing the returned UIDs.

## Problem `cmd/xr-invoiced/main.go` advances `st.HighestModSeq` even when `SearchSinceModSeq` fails. Reference: `cmd/xr-invoiced/main.go:148` and `cmd/xr-invoiced/main.go:167`. On CONDSTORE servers this can permanently skip changed messages: the search error is logged, but the state is still moved to the mailbox's newer `HighestModSeq`. ## Expected Keep the old `HighestModSeq` unless the modseq search succeeds and changed UIDs have been processed. ## Suggested fix Only assign `st.HighestModSeq = mailboxInfo.HighestModSeq` in the successful search path, ideally after processing the returned UIDs.
Author
Owner

Branch renamed per convention:

Old: regression/issue-10-highestmodseq
New: fix/10-highestmodseq-search-error

The old remote branch has been deleted.

Branch renamed per convention: Old: regression/issue-10-highestmodseq New: fix/10-highestmodseq-search-error The old remote branch has been deleted.
Author
Owner

Fix branch pushed: fix/10-highestmodseq-search-error-claude

Moves st.HighestModSeq = mailboxInfo.HighestModSeq inside the success path so the old modseq is preserved when SearchSinceModSeq fails. Regression test passes.

Fix branch pushed: [fix/10-highestmodseq-search-error-claude](https://forgejo.schlittermann.de/IUS/xr-invoiced/src/branch/fix/10-highestmodseq-search-error-claude) Moves st.HighestModSeq = mailboxInfo.HighestModSeq inside the success path so the old modseq is preserved when SearchSinceModSeq fails. Regression test passes.
Author
Owner
Implementation branch: [fix/10-highestmodseq-search-error-codex](https://forgejo.schlittermann.de/IUS/xr-invoiced/src/branch/fix/10-highestmodseq-search-error-codex)
Author
Owner

Fixed in 65ac9a7 and 5995f84, merged by 1c4ba83. HighestModSeq advancement is now guarded by successful search paths; regression coverage is present in modseq_regression_test.go.

Fixed in 65ac9a7 and 5995f84, merged by 1c4ba83. HighestModSeq advancement is now guarded by successful search paths; regression coverage is present in modseq_regression_test.go.
heiko closed this issue 2026-05-13 14:11:46 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IUS/xr-invoiced#10
No description provided.