[Bug]: a link label is set, drawn and then lost by serialize() #1513

Closed
opened 2026-11-15 14:21:57 +00:00 by jaylouisw · 0 comments
Owner

What happened

Setting a label on a link appears to work and the property is readable, but the label is
absent from Topology.serialize(), so any cable annotation (e.g. "via 0-LR-FP1 keystone 2",
"USB Ethernet adapter", "DOWN - host decommissioned") is dropped the moment the board is saved
and reloaded. Interface description survives the round trip; the link label does not.

Steps to reproduce

  1. const t = new Topology(); add two switches; t.connect('a','p1','b','p1')
  2. t.links.get(id).label = 'via faceplate 0-LR-FP1 keystone 2'
  3. const doc = t.serialize() and inspect doc.links[0]
  4. Also reproducible through the server: POST that document to /api/topologies/<id>/load
    and GET it back - the label is gone.

Expected

Either the label is part of the link document (and survives save/load), or setting it on the
live Link is refused so the caller knows it is not persisted. Silently accepting a value that
the serialiser discards is the failure mode that costs a user a whole cabling record.

Logs / output

$ node -e '...'
link keys: id,a,b,type,mediaId,speedMbps,duplex,lengthM,lagId,patchCord,state
label survives serialize? false undefined

Environment

Node v24.11.0, Windows 11, main (2625add0)

## What happened Setting a label on a link appears to work and the property is readable, but the label is absent from `Topology.serialize()`, so any cable annotation (e.g. "via 0-LR-FP1 keystone 2", "USB Ethernet adapter", "DOWN - host decommissioned") is dropped the moment the board is saved and reloaded. Interface `description` survives the round trip; the link label does not. ## Steps to reproduce 1. `const t = new Topology()`; add two switches; `t.connect('a','p1','b','p1')` 2. `t.links.get(id).label = 'via faceplate 0-LR-FP1 keystone 2'` 3. `const doc = t.serialize()` and inspect `doc.links[0]` 4. Also reproducible through the server: POST that document to `/api/topologies/<id>/load` and GET it back - the label is gone. ## Expected Either the label is part of the link document (and survives save/load), or setting it on the live Link is refused so the caller knows it is not persisted. Silently accepting a value that the serialiser discards is the failure mode that costs a user a whole cabling record. ## Logs / output ``` $ node -e '...' link keys: id,a,b,type,mediaId,speedMbps,duplex,lengthM,lagId,patchCord,state label survives serialize? false undefined ``` ## Environment Node v24.11.0, Windows 11, main (2625add0)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1513
No description provided.