tscircuit / tscircuit/schematic-trace-solver

[BUG] Router crashes on empty connections array

Open
#657 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
13
Forks
314
Avg merge
9h 3m
Merged PRs (30d)
132

Description

Describe the bug
All solvers crash when connections: [] is passed. Need early return guard.

Files affected

  • CapacityMeshSolver.ts
  • DirectLineSolver.ts
  • etc.

Proposed fix
Add if (!input.connections?.length) return { traces: [] } to each solver.

Would you accept a PR for this? Happy to add a bounty label if you want.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CapacityMeshSolver.ts and DirectLineSolver.ts, then identify the other solver files covered by the issue. Reproduce the crash with an empty connections array and verify that each solver returns an object with an empty traces array instead; add or run the relevant solver checks if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.