diff --git a/modules/messenger/cmd/messenger/asks.go b/modules/messenger/cmd/messenger/asks.go index 8045547f3..133503419 100644 --- a/modules/messenger/cmd/messenger/asks.go +++ b/modules/messenger/cmd/messenger/asks.go @@ -649,6 +649,9 @@ func (h *Holder) holdWhy(a oc.Ask) string { } parts = append(parts, why) } + case answerLevel(a) == occ.Destroy: + // Design 47 H-A-237 (3): the held ask names its level, which no channel carries yet (carriers). + parts = append(parts, Display(k.Kind)+": the ask is at the destroy level, and no channel carries a destroy answer yet (it needs a code)") } } if len(parts) == 0 { diff --git a/modules/messenger/cmd/messenger/review_test.go b/modules/messenger/cmd/messenger/review_test.go index 1bcac1d5b..51f01003e 100644 --- a/modules/messenger/cmd/messenger/review_test.go +++ b/modules/messenger/cmd/messenger/review_test.go @@ -149,6 +149,12 @@ func TestAFailedRootAskIsSaidAndKeepsAFreshWord(t *testing.T) { if why := h.holdWhy(heldAsk(c, "d-9")); !strings.Contains(why, "no responders") { t.Errorf("a held ask does not say why: %q", why) } + // Design 47 H-A-237 (3): an ask held at the destroy level says its level, which no channel carries yet. + destroy := heldAsk(c, "d-10") + destroy.Options[0].Level = occ.Destroy + if why := h.holdWhy(destroy); !strings.Contains(why, "destroy level") || !strings.Contains(why, "no channel carries a destroy answer yet") { + t.Errorf("a destroy ask held does not name its level: %q", why) + } } // H3: a message rendered while root is not free offers no approval; a word kept for rendering is never the diff --git a/modules/nats/cmd/nats-tools/requests.go b/modules/nats/cmd/nats-tools/requests.go index 5d25b5ccf..7c9d0d47e 100644 --- a/modules/nats/cmd/nats-tools/requests.go +++ b/modules/nats/cmd/nats-tools/requests.go @@ -229,7 +229,11 @@ func standingOf(rs requestStore, askID string) string { } } sort.Strings(kinds) - return "offered on " + strings.Join(kinds, ", ") + ": the operator is asked; the keeper acts once they approve, after a snapshot" + where := "offered on " + strings.Join(kinds, ", ") + if len(kinds) == 0 { + where = "offered, channel not yet named" + } + return where + ": the operator is asked; the keeper acts once they approve, after a snapshot" case "held": return "held by the router, not shown to the operator: " + rec.Held case string(occ.OutcomeRefused): diff --git a/modules/nats/cmd/nats-tools/requests_test.go b/modules/nats/cmd/nats-tools/requests_test.go index 1eaf49b51..006bb1cc8 100644 --- a/modules/nats/cmd/nats-tools/requests_test.go +++ b/modules/nats/cmd/nats-tools/requests_test.go @@ -191,6 +191,7 @@ func TestTheAskLastsTheCallersExpiryAndTheToolSaysTheRoutersStanding(t *testing. }{ {"", nil, "not yet taken in by the router"}, {`{"state":"open","tickets":{"a":{"kind":"telegram"},"b":{"kind":"telegram"},"c":{"kind":"desktop"}}}`, nil, "offered on desktop, telegram: the operator is asked"}, + {`{"state":"open"}`, nil, "offered, channel not yet named: the operator is asked"}, {`{"state":"held","held":"no channel carries destroy"}`, nil, "held by the router, not shown to the operator: no channel carries destroy"}, {`{"state":"refused","warrant":{"ask":"bus-r1","asker":"nats","outcome":"refused","words":"its words carry a path"}}`, nil, "refused by the router, so nothing will be removed: its words carry a path"}, {"", errors.New("no responders"), "cannot be read now (no responders)"},