From be1df04161fac0244c41b36896da4a8cbff66acc Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 18 Nov 2022 09:33:02 -0500 Subject: [PATCH] Fix test and cleanup msg status constants --- core/models/msgs.go | 18 ++++++++---------- runtime/config_test.go | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/models/msgs.go b/core/models/msgs.go index 790d5ea88..ce2fc2fc8 100644 --- a/core/models/msgs.go +++ b/core/models/msgs.go @@ -63,16 +63,14 @@ const ( type MsgStatus string const ( - MsgStatusInitializing = MsgStatus("I") - MsgStatusPending = MsgStatus("P") - MsgStatusQueued = MsgStatus("Q") - MsgStatusWired = MsgStatus("W") - MsgStatusSent = MsgStatus("S") - MsgStatusDelivered = MsgStatus("D") - MsgStatusHandled = MsgStatus("H") - MsgStatusErrored = MsgStatus("E") - MsgStatusFailed = MsgStatus("F") - MsgStatusResent = MsgStatus("R") + MsgStatusPending = MsgStatus("P") // incoming msg created but not yet handled + MsgStatusHandled = MsgStatus("H") // incoming msg handled + MsgStatusQueued = MsgStatus("Q") // outgoing msg created and queued to courier + MsgStatusWired = MsgStatus("W") // outgoing msg requested to be sent via channel + MsgStatusSent = MsgStatus("S") // outgoing msg having received sent confirmation from channel + MsgStatusDelivered = MsgStatus("D") // outgoing msg having received delivery confirmation from channel + MsgStatusErrored = MsgStatus("E") // outgoing msg which has errored and will be retried + MsgStatusFailed = MsgStatus("F") // outgoing msg which has failed permanently ) type MsgFailedReason null.String diff --git a/runtime/config_test.go b/runtime/config_test.go index f287a9646..de7386f35 100644 --- a/runtime/config_test.go +++ b/runtime/config_test.go @@ -18,7 +18,7 @@ func TestValidate(t *testing.T) { c.Redis = "??" c.Elastic = "??" c.SessionStorage = "??" - assert.EqualError(t, c.Validate(), "field 'DB' is not a valid URL, field 'ReadonlyDB' is not a valid URL, field 'Redis' is not a valid URL, field 'Elastic' is not a valid URL, field 'SessionStorage' is not a valid session storage mode") + assert.EqualError(t, c.Validate(), "field 'DB' is not a valid URL, field 'ReadonlyDB' is not a valid URL, field 'Redis' is not a valid URL, field 'SessionStorage' is not a valid session storage mode, field 'Elastic' is not a valid URL") c = runtime.NewDefaultConfig() c.DB = "mysql://temba:temba@localhost/temba"