fix: harden channel retry attribution and operations UI
This commit is contained in:
@@ -79,6 +79,7 @@ type Retry struct {
|
||||
|
||||
type SubmitResult struct {
|
||||
Envelope
|
||||
SubmitID string `json:"submitId"`
|
||||
SequenceID uint32 `json:"sequenceId"`
|
||||
GatewayMessageID string `json:"gatewayMessageId"`
|
||||
SubmitStatus string `json:"submitStatus"`
|
||||
|
||||
@@ -67,3 +67,20 @@ func TestSubmitCommandUnmarshalsQueuePriority(t *testing.T) {
|
||||
t.Fatalf("unexpected extension digits: %d", command.CMPP.ExtensionDigits)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubmitResultMarshalsSubmitID(t *testing.T) {
|
||||
payload, err := json.Marshal(SubmitResult{SubmitID: "submit-1"})
|
||||
if err != nil {
|
||||
t.Fatalf("marshal submit result: %v", err)
|
||||
}
|
||||
if string(payload) == "" || !json.Valid(payload) {
|
||||
t.Fatalf("invalid submit result JSON: %s", payload)
|
||||
}
|
||||
var decoded map[string]any
|
||||
if err := json.Unmarshal(payload, &decoded); err != nil {
|
||||
t.Fatalf("unmarshal submit result: %v", err)
|
||||
}
|
||||
if decoded["submitId"] != "submit-1" {
|
||||
t.Fatalf("submitId = %v, want submit-1", decoded["submitId"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user