mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-09-14 09:04:59 +08:00
fix(moveAsync): ZMS-215: fix incorrect existsEntries and removeEntries clearing in updateMessage() (#803)
* fix incorrect existsEntries and removeEntries clearing in updateMessage() * add clarifying comment
This commit is contained in:
parent
04b2751f87
commit
f0f35e1b67
1 changed files with 3 additions and 2 deletions
|
@ -197,6 +197,7 @@ class MessageHandler {
|
|||
|
||||
// get target mailbox data
|
||||
// get target user data
|
||||
// if throws will be handled by caller or wrapper
|
||||
let [mailboxData, userData] = await Promise.all([this.getMailboxAsync(options), this.users.collection('users').findOne({ _id: options.user })]);
|
||||
|
||||
if (!userData) {
|
||||
|
@ -2201,8 +2202,8 @@ class MessageHandler {
|
|||
this.notifier.addEntries(mailboxData, removeEntries, () => {
|
||||
// mark messages as added to new mailbox
|
||||
this.notifier.addEntries(targetData, existsEntries, () => {
|
||||
removeEntries = [];
|
||||
existsEntries = [];
|
||||
removeEntries.length = 0; // Clear top-level argument array, setting length to 0 clears array object
|
||||
existsEntries.length = 0;
|
||||
this.notifier.fire(mailboxData.user);
|
||||
return resolve(true);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue