A cable the loader cannot restore is dropped in silence, an undefined link state is adopted, a port can be cabled to itself, and serialize() hands out live endpoints #1323
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1323
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 other half of the round trip. Every option
connect()accepts survives a save and reload — that part wasalways true, and there was no test for it either. What is not true is what happens to a cable the loader cannot
restore: it was skipped by a bare
catch, so a document with two cables could come back with one and nothinganywhere said so.
Measured against the current loader:
Why each of those is a lie rather than a tolerated edge
described, one lost, no message. Same family as #1315 (two boards, one file).
state: 'sideways'. The HTTP API refuses an unknown state with422 E_BAD_STATE; the load path acceptedanything. A cable then sits in a state that is neither up nor down nor blocked:
isUp()is false,show interfacesreports a link that cannot carry, and nothing explains why.word, so an imported lab can differ from the document it came from and the operator has no way to tell which
cable went missing.
stateSinceMs: 'soon'becamenull— "not at any known time" — throughNumber(...)and JSON.serialize()handed out its own endpoint records. The document the API, the UI, the example builder and everytest fixture receives was the live board; a caller adjusting the document it was given adjusted the lab.
What must be true instead
connect()accepts round-trips exactly (tested, not assumed);loadIssueswith a code and the engine's own sentence, and everystate payload carries the list next to
verdicts(the #1306 rule);E_LINK_DUPLICATE_ID,E_LINK_BAD_STATE(naming the states that exist),E_LINK_SELF_LOOP,E_LINK_ENDPOINT_MISSING(naming the end),E_LINK_NOT_RESTORED(the engine's reason);serialize()hands out copies, so a document can be edited without editing the board;loadIssuesempty, nothing to explain.layoutis handed out live, outlives its device, accepts anything (NaN boxes, silently lost arrays), and the API reads 0 as missing #1325runtime[].countershas two shapes (drops/ports missing on idle devices) and hands out the engine's live record #1329show link stateprints an instant as a duration #1331