In partially-successful group send, don't start expire timer

This commit is contained in:
Scott Nonnenberg 2018-08-06 11:33:51 -07:00
parent 9ed1ee90f8
commit 9ff80469a5

View file

@ -824,7 +824,6 @@
this.trigger('pending');
return promise
.then(async result => {
const now = Date.now();
this.trigger('done');
// This is used by sendSyncMessage, then set to null
@ -836,7 +835,7 @@
this.set({
sent_to: _.union(sentTo, result.successfulNumbers),
sent: true,
expirationStartTimestamp: now,
expirationStartTimestamp: Date.now(),
});
await window.Signal.Data.saveMessage(this.attributes, {
@ -846,7 +845,6 @@
this.sendSyncMessage();
})
.catch(result => {
const now = Date.now();
this.trigger('done');
if (result.dataMessage) {
@ -867,10 +865,12 @@
this.saveErrors(result.errors);
if (result.successfulNumbers.length > 0) {
const sentTo = this.get('sent_to') || [];
// Note: In a partially-successful group send, we do not start
// the expiration timer.
this.set({
sent_to: _.union(sentTo, result.successfulNumbers),
sent: true,
expirationStartTimestamp: now,
});
promises.push(this.sendSyncMessage());
}