MessageReceiver: Ensure that we always clearTimeout before set
This commit is contained in:
parent
c7c8bcc33a
commit
104b694186
2 changed files with 4 additions and 3 deletions
|
@ -263,6 +263,7 @@ MessageReceiver.prototype.extend({
|
||||||
const ev = new Event('empty');
|
const ev = new Event('empty');
|
||||||
this.dispatchAndWait(ev);
|
this.dispatchAndWait(ev);
|
||||||
this.isEmptied = true;
|
this.isEmptied = true;
|
||||||
|
|
||||||
this.maybeScheduleRetryTimeout();
|
this.maybeScheduleRetryTimeout();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -393,6 +394,7 @@ MessageReceiver.prototype.extend({
|
||||||
},
|
},
|
||||||
maybeScheduleRetryTimeout() {
|
maybeScheduleRetryTimeout() {
|
||||||
if (this.isEmptied) {
|
if (this.isEmptied) {
|
||||||
|
this.clearRetryTimeout();
|
||||||
this.retryCachedTimeout = setTimeout(() => {
|
this.retryCachedTimeout = setTimeout(() => {
|
||||||
this.pendingQueue.add(() => this.queueAllCached());
|
this.pendingQueue.add(() => this.queueAllCached());
|
||||||
}, RETRY_TIMEOUT);
|
}, RETRY_TIMEOUT);
|
||||||
|
@ -450,7 +452,6 @@ MessageReceiver.prototype.extend({
|
||||||
this.queueEnvelope(item.envelope);
|
this.queueEnvelope(item.envelope);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.clearRetryTimeout();
|
|
||||||
this.maybeScheduleRetryTimeout();
|
this.maybeScheduleRetryTimeout();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
|
|
|
@ -1244,7 +1244,7 @@
|
||||||
"rule": "jQuery-wrap(",
|
"rule": "jQuery-wrap(",
|
||||||
"path": "libtextsecure/message_receiver.js",
|
"path": "libtextsecure/message_receiver.js",
|
||||||
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
|
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
|
||||||
"lineNumber": 751,
|
"lineNumber": 752,
|
||||||
"reasonCategory": "falseMatch",
|
"reasonCategory": "falseMatch",
|
||||||
"updated": "2019-10-21T22:30:15.622Z"
|
"updated": "2019-10-21T22:30:15.622Z"
|
||||||
},
|
},
|
||||||
|
@ -1252,7 +1252,7 @@
|
||||||
"rule": "jQuery-wrap(",
|
"rule": "jQuery-wrap(",
|
||||||
"path": "libtextsecure/message_receiver.js",
|
"path": "libtextsecure/message_receiver.js",
|
||||||
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
|
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
|
||||||
"lineNumber": 776,
|
"lineNumber": 777,
|
||||||
"reasonCategory": "falseMatch",
|
"reasonCategory": "falseMatch",
|
||||||
"updated": "2019-10-21T22:30:15.622Z"
|
"updated": "2019-10-21T22:30:15.622Z"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue