link down says the cable was pulled at t=0, whatever instant the session is standing at #1385
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1385
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?
Simulator.setLinkState()readsNumber(o.atMs) || 0, so a cable change with no instant named is stamped t=0,always. Typed into a console standing at t=60000:
The same board, asked the same question through the API with
atMs: 60000, answers 90000. The two doorsdisagree and one of them is nonsense.
markTopologyChange()— two methods up, written for exactly this reason in #1331 — already has the right rule: theoperator's instant, else 0.
Three defects in one call:
atMs: "abc"is coerced to 0 (Number(...) || 0), so a mistyped instant moves the cable and stamps it atzero, silently. The server does the same coercion before the engine ever sees the value, and maps every failure
to
404 no such link.link statetestsl.stateSinceMsfor truth, so a cable pulled at t=0 — the first change in a run's life —prints its state with no instant at all, while every later change prints one.
What must be true instead
instant) starts at 0 — the rule
markTopologyChange()already applies;atMsthat is not a time at or after 0 is refused asE_BAD_INSTANTby the engine and answered400by theAPI, with the cable untouched;
link stateprintschanged at 0 ms (N ms ago)when that is the truth.