Fail over to all numbers in retry if errors don't have numbers

This commit is contained in:
Scott Nonnenberg 2019-01-28 15:24:46 -08:00
parent 92c071e083
commit 1533fcc807
2 changed files with 16 additions and 6 deletions

View file

@ -711,13 +711,23 @@
this.set({ errors });
const profileKey = null;
const numbers = retries.map(retry => retry.number);
let numbers = retries
.map(retry => retry.number)
.filter(item => Boolean(item));
if (!numbers.length) {
window.log.error(
'retrySend: Attempted to retry, but no numbers to send to!'
window.log.warn(
'retrySend: No numbers in error set, using all recipients'
);
return null;
const conversation = this.getConversation();
if (conversation) {
numbers = conversation.getRecipients();
this.set({ errors: null });
} else {
throw new Error(
'No numbers in error set, did not find conversation for message'
);
}
}
const attachmentsWithData = await Promise.all(

View file

@ -207,7 +207,7 @@
"rule": "jQuery-wrap(",
"path": "js/models/messages.js",
"line": " this.send(wrap(promise));",
"lineNumber": 810,
"lineNumber": 820,
"reasonCategory": "falseMatch",
"updated": "2018-10-05T23:12:28.961Z"
},
@ -215,7 +215,7 @@
"rule": "jQuery-wrap(",
"path": "js/models/messages.js",
"line": " return wrap(",
"lineNumber": 1019,
"lineNumber": 1029,
"reasonCategory": "falseMatch",
"updated": "2018-10-05T23:12:28.961Z"
},