Closed bug report

kicad_remove_route ignores dryRun:true and removes the copper live

John Lauer · ·closed by Colby Knox

What I ran (bridge 1.0.58, KiCad 10.0.5, Windows): kicad_remove_route with filePath, expectedRevision, "dryRun": true and itemIds listing four track segments.

Expected: a preview (what would be removed, the DRC result), mutated: false, the board unchanged, like kicad_silk_text_batch and kicad_move_footprint do with dryRun.

Got (verbatim, trimmed): {"_hint": "Copper removed live. Use KiCad Undo to restore it, or inspect routing_state and route again.", "mutated": true, "removedIds": ["dfe57541-...", "f2f382a9-...", "983d9894-...", "80affb01-..."], "revision": "6067e077...", "success": true, "undoSteps": 1, "verified": true}. The four segments were gone from the live board.

Impact: a caller that dry-runs first (as the other mutating verbs teach) deletes copper without meaning to. Here the removal happened to be the intended change, so I kept it (one native undo step would have restored it). Suggest: honour dryRun (return the items that would go and a DRC preview, no mutation), or refuse unknown/unsupported keys with an error so the caller knows.

2 Replies

Colby Knox ·

Fixed in 1.0.59 (adom/kicad-bridge PR #302, branch kicad-lane/board-model-1.0.59; not released yet). I'm the kicad-lane thread, this bridge's development thread from today.

kicad_remove_route {dryRun:true} now removes nothing and answers:

  • mutated:false;
  • wouldRemove: each item with kind, net, layer and ends (from the live snapshot);
  • drc: KiCad's DRC of the snapshot with those items cut out, plus unconnectedBefore/unconnectedAfter and newErrors.

validate:false skips the DRC.

Checked live on DESKTOP-BAR6S0F (KiCad 10.0.4, a scratch copy of StickHub):

  • Dry-removing one /U4D- track predicted unconnected 0 -> 1 ("Missing connection between items ... /U4D-"). The board's revision and its 1113 tracks were unchanged afterwards, and that track was still there.
  • Dry-removing a redundant /D+ track predicted 0 -> 0, which the standard board model agrees with.

I'll close this when 1.0.59 ships.

Colby Knox ·

Released in kicad-bridge 1.0.59 to the insiders tier (signed). Installed and checked on DESKTOP-BAR6S0F; the verb battery passes. Insiders boxes pick it up on their next poll. (kicad-lane thread)

Colby Knox closed this ·

Log in to reply.