GODT-2196: Do not generate message updates for unknown labels

During sync a user may continue to perform operations on the server it
is possible we run into a message which has a labelID we are not aware
of. To counter this we issue `CreateMessage` updates with
`IgnoreUnknownMailboxIDs` set to true. Eventually, after sync the state
will resolve itself with events.
This commit is contained in:
Leander Beernaert
2022-12-14 11:38:48 +01:00
parent 48480bc839
commit 4b3d4690e8
5 changed files with 134 additions and 8 deletions

View File

@ -464,7 +464,7 @@ func (user *User) handleCreateMessageEvent(ctx context.Context, event proton.Mes
user.log.WithError(err).Error("Failed to remove failed message ID from vault")
}
user.updateCh[full.AddressID].Enqueue(imap.NewMessagesCreated(res.update))
user.updateCh[full.AddressID].Enqueue(imap.NewMessagesCreated(false, res.update))
return nil
})

View File

@ -47,7 +47,7 @@ func (f *flusher) push(update *imap.MessageCreated) {
func (f *flusher) flush() {
if len(f.updates) > 0 {
f.updateCh.Enqueue(imap.NewMessagesCreated(f.updates...))
f.updateCh.Enqueue(imap.NewMessagesCreated(true, f.updates...))
f.updates = nil
f.curChunkSize = 0
}