From 850da6611697186e6f8aab09c30f218ceefee893 Mon Sep 17 00:00:00 2001 From: Ben Bucksch Date: Thu, 28 Nov 2024 14:04:25 +0100 Subject: [PATCH] SQL: Re-enable saving of message headers --- app/logic/Mail/IMAP/IMAPFolder.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/logic/Mail/IMAP/IMAPFolder.ts b/app/logic/Mail/IMAP/IMAPFolder.ts index 9f793751a..6fb8cf236 100644 --- a/app/logic/Mail/IMAP/IMAPFolder.ts +++ b/app/logic/Mail/IMAP/IMAPFolder.ts @@ -371,15 +371,11 @@ export class IMAPFolder extends Folder { .first as IMAPEMail; // oldest } - /** Save headers of newly discovered emails */ + /** Save partial headers of newly discovered emails. + * + * Note: Completely downloaded emails are not saved here, but in + * `downloadMessages()` -> `msg.saveCompleteMessage()` */ protected async saveNewMsgs(msgs: Collection) { - // Saving message headers is slow and expensive, - // and it drags down the whole app. - // It's faster to re-download the headers from the server. - // Disable saving only message headers for now. - // We will still save the completely downloaded emails, in - // `downloadMessages()` -> `msg.saveCompleteMessage()` - return; let startTime = Date.now(); await this.storage.saveMessages(msgs); let saveTime = Date.now() - startTime;