Fix bug gathering "changes" to broadcast during a mailbox rename in certain situations

We weren't appending the individual changes to the slice, but the entire slice.
Since "Change" is an "any", this isn't a type error. So make a Change a
non-empty interface (I had seen an issue like this coming, should have made it
an interface then, at least now we have a reasonable method, to get the modseq
of a change).

Found while working on an imap webpush prototype.
This commit is contained in:
Mechiel Lukkien
2025-03-15 10:45:35 +01:00
parent 0cf0bfb8a6
commit eadbda027c
2 changed files with 28 additions and 2 deletions

View File

@ -3578,7 +3578,7 @@ func (a *Account) MailboxRename(tx *bstore.Tx, mbsrc *Mailbox, dst string, modse
// If we were moved from a/b to a/b/x, we mention the creation of a/b after we mentioned the rename.
if strings.HasPrefix(dst, origName+"/") {
changes = append(changes, parentChanges)
changes = append(changes, parentChanges...)
} else {
changes = slices.Concat(parentChanges, changes)
}