a trace connecting a port to itself is accepted silently and emits a duplicate-port source_trace
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 58
- Forks
- 203
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 286
Description
What happens
A trace whose two ends resolve to the same port is accepted silently:
<resistor name="R1" resistance="1k" footprint="0402" />
<trace from=".R1 > .pin1" to=".R1 > .pin1" />
source_trace.connected_source_port_ids ["source_port_0", "source_port_0"]
errors 0
The trace connects nothing, but it still produces a source_trace element listing the same port twice. Downstream that's a connection record that can never be routed and can't mean anything electrically.
The only feedback the user gets is unrelated: source_pin_missing_trace_warning for the other pin — which actively points away from the real mistake.
Why it matters
from=".R1 > .pin1" to=".R1 > .pin1" is a copy-paste slip — you edit one selector and forget the other. It looks connected in the source, renders without complaint, and the missing connection only shows up much later.
Compare with the neighbouring cases, which are all diagnosed properly:
- unknown component →
Could not find port for selector ... - unknown pin →
... does not have pin "NOPE" - unnamed trace →
... is missing a name
A self-connection is the one malformed trace with no message.
Suggested behaviour
Reuse source_trace_not_connected_error, which already exists for traces that can't be connected:
<trace#27(from:.R1 > .pin1 to:.R1 > .pin1) /> connects a port to itself;
both ends resolve to the same port. Did you mean to connect two different pins?
Cases deliberately NOT flagged
I checked several neighbours and left them alone because they can be legitimate:
<trace from=".R1 > .pin1" to="net.VCC" />— resolves to one port plus a net; normal.- both pins of a part joined to the same net — unusual but a real circuit (e.g. a jumper/link), not obviously an error.
- duplicate identical traces — already deduplicated via the existing connection-hash lookup.
PR ready.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the source_trace_not_connected_error path and the existing connection-hash lookup that handles duplicate traces. Reproduce the self-connection example, then verify the error is emitted while net endpoints, same-net pin joins, and duplicate traces retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100