diff --git a/backends/rapidpro/backend_test.go b/backends/rapidpro/backend_test.go index e06171b8..d2c21a09 100644 --- a/backends/rapidpro/backend_test.go +++ b/backends/rapidpro/backend_test.go @@ -567,10 +567,10 @@ func (ts *BackendTestSuite) TestMsgStatus() { ts.Equal(pq.StringArray(nil), m.LogUUIDs) // update to FAILED using external id - clog5 := updateStatusByExtID("ext1", courier.MsgStatusFailed) + clog5 := updateStatusByExtID("ext1", courier.MsgStatusQueued) m = readMsgFromDB(ts.b, 10000) - ts.Equal(courier.MsgStatusFailed, m.Status_) + ts.Equal(courier.MsgStatusQueued, m.Status_) ts.True(m.ModifiedOn_.After(now)) ts.Nil(m.SentOn_) ts.Equal(pq.StringArray([]string{string(clog5.UUID)}), m.LogUUIDs) @@ -992,7 +992,7 @@ func (ts *BackendTestSuite) TestOutgoingStatusUpdateOutOfOrder() { time.Sleep(2 * time.Millisecond) m = readMsgFromDB(ts.b, msg.ID()) - ts.Equal(m.Status_, courier.MsgStatusWired) + ts.Equal(m.Status_, courier.MsgStatusFailed) // status should remain failed } diff --git a/backends/rapidpro/status.go b/backends/rapidpro/status.go index 690ffe58..e2141df9 100644 --- a/backends/rapidpro/status.go +++ b/backends/rapidpro/status.go @@ -53,7 +53,7 @@ const sqlUpdateMsgByID = ` UPDATE msgs_msg SET status = CASE WHEN - s.status = 'E' + s.status = 'E' OR msgs_msg.status = 'F' THEN CASE WHEN error_count >= 2 OR msgs_msg.status = 'F'