mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-01 16:12:02 +00:00
Stalwart's change ids only grow. An upgrade that keeps the old change log but restarts the counters lower (1.0 counts per collection where 0.16 counted per account) makes Email/changes and Mailbox/changes accept an old state and answer with a lower `newState` and no changes, so the delta sync would silently skip everything that changed since. Read Stalwart `s` states (LEB128 in Stalwart's base32) and treat a `newState` below `sinceState` like `cannotCalculateChanges`: fetch in full. The check runs only on accounts that list `urn:stalwart:jmap`, only for states in the exact form Stalwart writes, and never trips while states go up.