diff --git a/dist/libsignal-protocol.js b/dist/libsignal-protocol.js index 9614701..2fd65a4 100644 --- a/dist/libsignal-protocol.js +++ b/dist/libsignal-protocol.js @@ -36176,6 +36176,10 @@ SessionCipher.prototype = { return this.doDecryptWhisperMessage(buffer, session).then(function(plaintext) { return { plaintext: plaintext, session: session }; }).catch(function(e) { + if (e.name === 'MessageCounterError') { + return Promise.reject(e); + } + errors.push(e); return this.decryptWithSessionList(buffer, sessionList, errors); }.bind(this)); diff --git a/src/SessionCipher.js b/src/SessionCipher.js index 334dee8..b9871e7 100644 --- a/src/SessionCipher.js +++ b/src/SessionCipher.js @@ -124,6 +124,10 @@ SessionCipher.prototype = { return this.doDecryptWhisperMessage(buffer, session).then(function(plaintext) { return { plaintext: plaintext, session: session }; }).catch(function(e) { + if (e.name === 'MessageCounterError') { + return Promise.reject(e); + } + errors.push(e); return this.decryptWithSessionList(buffer, sessionList, errors); }.bind(this));