A position of 1e308 is accepted by both doors and opens a blank canvas #1421
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1421
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?
Two doors set a device's position:
POST /api/topologies/:name/layout(the drag, and the tidy-up button) andTopology.fromJSON()on load. Both ask for{ x, y }with two finite numbers — and the endpoint keeps its own copy of that sentence inline while the engine asksisPosition(). One rule, two implementations, the shape that has already drifted six times in this repository.Both accept
1e308. Measured against a live server:1e308is a finite number and it is not a place. Inweb/canvas.jsfitView()the board's width is the largest x minus the smallest —Infinityfor two such positions — so zoom clamps to its 0.25 floor,translate()is handed-1e308, and the canvas draws nothing. "Fit to view" computes the same arithmetic, so the board cannot be recovered from the UI at all. The lab is not lost; it cannot be seen, which for a person is the same thing. Reachable from an imported document, a hand-edited one, or an auto-layout script with a bug.Two smaller holes at the same door:
{"positions": [..]},{"positions": "abc"},{}→200 {"ok":true}and nothing happens: the same 200-that-lies shape as #1309.What should be true
WORLD_LIMIT = 1e6pixels from the origin — the largest lab the catalogue can build spans tens of thousands);E_LAYOUT_BAD_ENTRY), so the board still opens;positionsthat is not a map is400; an unknown id comes back inignored;fitView()checks its own result — if the centre of what it measured does not land in the viewport, the framing failed and the default view is the honest answer, which also covers documents written before the limit existed;web/canvas.js: every position the doors accept is one the canvas can frame.