Skip to content

Commit

Permalink
Fix test and cleanup msg status constants
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Nov 18, 2022
1 parent 21e12ec commit be1df04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions core/models/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runtime/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit be1df04

Please sign in to comment.