mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 03:34:39 +03:00
update modseq when changing mailbox/server metadata, and also for specialuse changes, and keep track of modseq for mailboxes
i added the metadata extension to the imapserver recently. then i wondered how a client would efficiently find changed metadata. turns out the qresync rfc mentions that metadata changes should set a new modseq on the mailbox. shouldn't be hard, except that we were not explicitly keeping track of modseqs per mailbox. we only kept them for messages, and we were just looking up the latest message modseq when we needed the modseq (we keep db entries for expunged messages, so this worked out fine). that approach isn't enough anymore. so know we keep track of modseq & createseq for mailboxes, just as for messages. and we also track modseq/createseq for annotations. there's a good chance jmap is going to need it. this also adds consistency checks for modseq/createseq on mailboxes and annotations to the account storage. it helped spot cases i missed where the values need to be updated.
This commit is contained in:
@ -298,7 +298,7 @@ func importctl(ctx context.Context, ctl *ctl, mbox bool) {
|
||||
a.WithWLock(func() {
|
||||
// Ensure mailbox exists.
|
||||
var mb store.Mailbox
|
||||
mb, changes, err = a.MailboxEnsure(tx, mailbox, true, store.SpecialUse{})
|
||||
mb, changes, err = a.MailboxEnsure(tx, mailbox, true, store.SpecialUse{}, &modseq)
|
||||
ctl.xcheck(err, "ensuring mailbox exists")
|
||||
|
||||
// We ensure keywords in messages make it to the mailbox as well.
|
||||
|
Reference in New Issue
Block a user