Skip to content

Commit cce4652

Browse files
committed
fix(twilio): fix logic for delivery report handling
1 parent 4db022c commit cce4652

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/server/api/lib/twilio.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
appendServiceResponse
1414
} from "./message-sending";
1515
import {
16+
SpokeSendStatus,
1617
getCampaignContactAndAssignmentForIncomingMessage,
1718
saveNewIncomingMessage,
1819
messageComponents
@@ -330,15 +331,10 @@ export const processDeliveryReport = async body => {
330331
send_status: getMessageStatus(MessageStatus)
331332
})
332333
.where({ service_id })
333-
.where(builder =>
334-
builder
335-
.whereNot({
336-
send_status: SpokeSendStatus.Delivered
337-
})
338-
.orWhereNot({
339-
send_status: SpokeSendStatus.Error
340-
})
341-
);
334+
.whereNotIn("send_status", [
335+
SpokeSendStatus.Delivered,
336+
SpokeSendStatus.Error
337+
]);
342338
};
343339

344340
async function handleIncomingMessage(message) {

0 commit comments

Comments
 (0)