From 96978c4ea2c5bb0557feb70c35576bc312438948 Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Wed, 31 Dec 2025 20:43:19 +0100 Subject: [PATCH] [Chore]: Reload inbox when receiving onDelete signal --- application/mail-processing-service.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/mail-processing-service.js b/application/mail-processing-service.js index 125adc6..39e530b 100644 --- a/application/mail-processing-service.js +++ b/application/mail-processing-service.js @@ -169,7 +169,24 @@ class MailProcessingService extends EventEmitter { debug('Failed to clear email cache:', err.message) } + // Find which addresses have this UID before removing it + const affectedAddresses = [] + this.mailRepository.mailSummaries.forEachAssociation((mails, address) => { + if (mails.some(mail => mail.uid === parseInt(uid))) { + affectedAddresses.push(address) + } + }) + + // Remove from repository this.mailRepository.removeUid(uid) + + // Notify affected inboxes to reload + if (this.initialLoadDone) { + affectedAddresses.forEach(address => { + debug('Notifying inbox after deletion:', address) + this.clientNotification.emit(address) + }) + } } async _deleteOldMails() {