Skip to content

Commit

Permalink
fix ImportMailState CREATE event not downloading imported mails
Browse files Browse the repository at this point in the history
After importing mails on the desktop client, those mails are not visible
immediately on other devices with offline storage. This is due to the
optimization of EntityEvents (CREATE + UPDATE = CREATE). Previously, the
mails were only downloaded on ImportMailState UPDATE events in the
MailViewModel, which are never processed on the devices not making the
import. This led to a corrupted state where the imported mails are never
downloaded to the device. This fix ensures that the mails are downloaded
and the offline storage is updated properly.

Co-authored-by: jhm <[email protected]>
  • Loading branch information
abdulkadir-tutao and jomapp committed Jan 24, 2025
1 parent 1cd868d commit 9023888
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mail-app/mail/view/MailViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,10 @@ export class MailViewModel {
this.stickyMailId = null
}
}
} else if (isUpdateForTypeRef(ImportMailStateTypeRef, update) && update.operation == OperationType.UPDATE) {
} else if (
isUpdateForTypeRef(ImportMailStateTypeRef, update) &&
(update.operation == OperationType.CREATE || update.operation == OperationType.UPDATE)
) {
importMailStateUpdates.push(update)
}

Expand Down

0 comments on commit 9023888

Please sign in to comment.