The canvas draws a refused cable as refused (#1305) #1306
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1306
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/canvas-cable-verdict"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The canvas draws a refused cable as refused.
Fixes #1305.
The gap
#1304 gave every state payload a verdict per cable (
state.verdicts, filed under the cable that caused it) andtaught the cable inspector to print it. The canvas was the last surface still drawing on its own opinion: an
impossible cable — copper terminated in a fibre cage, an optic the port cannot seat — came out as the same 2 px
line as a good one.
link-downalready existed for a cut cable, and it is not the same fault: a cut is a state, an impossiblecable is up and simply cannot be what it claims. Different fixes, so different pictures.
After
link-invalidlink-caveatstate: down(a cut cable)link-down(unchanged)data-link-valid="true"Every cable line carries
data-link-valid(true/warn/false/unchecked),data-link-issue(the code)and
data-link-issue-text(the sentence), plus a<title>so the message is there on hover without a click.uncheckedmeans the payload carried no verdict — the drawing claims nothing rather than implying the cable isfine, the same rule as #1299 and #1301.
Two things the test forced, both real
refused;
.filter()straight off thelist, so a
nullentry threw, the per-linktry/catchswallowed it, and the refused cable vanished from thecanvas entirely — worse than drawing it as good. The test's "a malformed issue does not throw" case found it.
Evidence
test/canvas-cable-verdict.test.js— 26 checks against the realweb/canvas.jsin a recording stub DOM:refused, clean, caveat, down-only, down-and-refused, no verdict at all, a verdict object that says it could not
check, two cables where one is bad, and the malformed-issue case. With
web/canvas.jsreverted, 17 of the 26fail.
docs/CONNECTORS.md: the drawing rules, and why a caveat is not a refusal.Suite: 168 suites, 6,843 assertions, 0 failed.
serialize()hands out live endpoints #1323