Skip to content

Fix pcbStraightLine render crash when fewer than two ports connected#2561

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-pcb-straight-line-insufficient-ports-crash
Draft

Fix pcbStraightLine render crash when fewer than two ports connected#2561
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-pcb-straight-line-insufficient-ports-crash

Conversation

@posthog

@posthog posthog Bot commented Jul 2, 2026

Copy link
Copy Markdown

A pcbStraightLine manual trace that resolved fewer than two connected ports (e.g. a trace connecting a port to a net) aborted the entire circuit render with an unhandled exception. Trace_doInitialPcbManualTraceRender called trace.renderError(...), and renderError throws a raw Error for string messages — so it bubbled up through renderUntilSettled instead of being a soft render error.

This swaps that throwing call for a db.pcb_trace_error.insert(...) + return, matching every sibling error path in the same file. The misconfiguration now surfaces as a proper pcb_trace_error the UI can display, and the rest of the render completes.

Why: users of pcbStraightLine hit a full render crash with no workaround when a trace did not resolve exactly two connected ports; this makes it a graceful, contained error instead.

Added a regression test that connects a single port to a net with pcbStraightLine and asserts the render settles with one pcb_trace_error.


Created with PostHog Code from an inbox report.

When a `pcbStraightLine` manual trace resolves fewer than two connected
ports, the render aborted with an unhandled exception because
`renderError` throws a raw `Error` for string messages.

Insert a `pcb_trace_error` and return instead, matching the sibling
error paths in the same file. The misconfiguration now surfaces as a
proper trace error the UI can show, rather than taking down the whole
circuit render.

Generated-By: PostHog Code
Task-Id: 150cbbb0-57db-42cf-89a7-eaceaf0d4980
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Jul 2, 2026 10:13pm

Request Review

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants