From 7c5bf84c5288367fe1f019e25db11eccd5a2fa67 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Tue, 1 Oct 2019 16:27:10 +0300 Subject: [PATCH] do not use .finally() because of Node v8 --- lib/message-handler.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/message-handler.js b/lib/message-handler.js index cd7d70f5..4787400a 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -493,15 +493,20 @@ class MessageHandler { } }; - return processAudits().finally(() => { - return cleanup(null, true, { + let next = () => { + cleanup(null, true, { uidValidity, uid, id: messageData._id, mailbox: mailboxData._id, status: 'new' }); - }); + }; + + // do not use more suitable .finally() as it is not supported in Node v8 + return processAudits() + .then(next) + .catch(next); } ); });