Design 47 H1: a held destroy-level ask says its level; an offer with no channel named says so
The router held the bus module's destroy-level asks with the bare words "no channel can carry it now", so the asker could not tell why. holdWhy now names the destroy level and that no channel carries a destroy answer yet. The bus module's tool says "offered, channel not yet named" for an open record with no tickets, never "offered on :". Builds: design 47 H H-A-237 (3), H-A-239 (2)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)"},
|
||||
|
||||
Reference in New Issue
Block a user