The packet log showed a bare token for 17 event types #1475
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1475
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 symptom
The packet log is the panel whose job is to explain what happened to a frame. Seventeen of the fifty-four event types the engine emits had no legend line, so they fell through to
default: return e.typeand the row read:Not an error, not a blank — a row that names a mechanism instead of saying what happened, in the one place a learner goes to find out. One of the seventeen was added the day before (the
arp-conflictevent in #1473), which is what made the cause obvious: nothing connected the engine's event vocabulary to the legend, so a new_emit({ type: … })was silently a new bare token.The fix
undefinedin the panel meant to explain things, so the test reads each emit site's field list from the engine source and compares. It caught one immediately:flow-resetreade.proto, which that event does not carry — a reset is TCP by definition.dropcolour class instead of passing as ordinary chatter.tap-inject-refusednow carries areasonon the wire, so the log can say why the frame was not re-injected instead of only that it wasn't.__pf.describeEvent, the same way the rest of the UI is exposed for tests.The test that makes it stop happening
test/event-legend.test.jsenumerates the vocabulary fromengine/rather than from a hand-written list: every_emit({ type: … })andevents.push({ type: … })must have a case, no case may describe an event the engine no longer emits, no type may be described twice, and every real emit-site payload must render as a sentence rather than its bare type.The general rule, worth stating once: a view may not display a token it cannot explain. If the engine can emit it, the panel says what it means — and the connection between the two is a test, not a habit.
Neighbours green:
ui-render38,ui-dom-contract19,ui-action-failures13,arp-conflict26,runtime-agreement10,report-sweep21. Syntax 304 files OK. Full suite: 236 suites, 8827 assertions, 0 failed.Landed as #1476 (
edd262cb). Post-merge onmain:event-legend18,ui-render38, tree clean.All 54 event types now have a sentence, and the legend may only read fields the event carries - the check reads each emit site's field list straight out of
engine/, which is how it caughtflow-resetreadinge.protothat the event never sends. A view may not display a token it cannot explain.