Two boards can share one file, a created board is never saved, a non-board file loads as an empty lab, and a board named a b cannot be reached #1315
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1315
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 persistence code reads well and carries a comment explaining why the debounce was removed (on Windows a kill
calls TerminateProcess, so nothing on a timer survives). Nobody had ever checked the disk. Four defects.
1. Two boards whose names look alike share one file
a banda_bboth becomea_b.json. Two boards, one file: whichever saves last wins, and after a restart onlyone of them exists. Measured —
POST /api/topologies {id:"a b"}and{id:"a_b"}, then a device on each:2. A board that was created is not saved
POST /api/topologies {id:"lab"}answers 201 and puts the board in memory. Nothing writes it until something elsemutates it, so "make a board, name it, come back tomorrow" loses it — and
GET /api/topologieswill not list itafter a restart.
3. A file that parses but is not a board is adopted as an EMPTY board
Topology.fromJSON()is tolerant on purpose (it reads old files), so{"format":"packetforge-topology"}— or anyobject without
devices/links— becomes an empty board under that id. The operator opens the app and their labis gone, with nothing said and nothing logged. This is the read-side twin of #1309, where
/loademptied the boardand reported success.
4. A board called
a bcan be created and then never reached againThe topology id is taken straight out of the path (
parts[2]) with no decoding, so once a client percent-encodesit — which it must — every endpoint answers 404:
Port names learned this in #1307. Boards had not.
What must be true instead
log (it is the operator's work; a later version may read it);
an exception;
the time it answers, and a SIGKILL immediately after an answer loses nothing.
serialize()hands out live endpoints #1323