From 08ec77377047632e27d9918a19201e74a2b63d37 Mon Sep 17 00:00:00 2001 From: mscdex Date: Wed, 10 Apr 2013 19:18:08 -0400 Subject: [PATCH] explicitly wait for idle continuation before sending DONE --- lib/imap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/imap.js b/lib/imap.js index d90e53d..49b02ae 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -1587,7 +1587,8 @@ ImapConnection.prototype._send = function(cmdstr, cb) { } if (idle.state !== IDLE_NONE && cmdstr !== 'DONE') { - if (cmdstr !== undefined && idle.state !== IDLE_DONE) { + if ((cmdstr !== undefined || reqs.length > 1) + && idle.state === IDLE_IDLING) { idle.state = IDLE_DONE; this._send('DONE'); }