Fix async matching for repeated footprint pads - #3352
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source_component_internal_connectionrecords when async port initialization dirties source attachmentkicad:-style regression for a four-pad switch with pad numbers1, 1, 2, 2Why
When a library footprint loaded asynchronously, the component's cached
selectAll("port")result could still contain only the two primary switch ports. The footprint correctly inferred two additional physical ports for the separated duplicate-numbered pads, but pad matching read the stale cache and attached both pad 1 instances to the primary pin 1 (and likewise for pin 2).PcbPortRenderthen treated each primary port as ambiguous and emitted no PCB ports.Invalidating selector caches at the tree mutation boundary makes the newly added ports visible before
PortMatching. Updating source-parent attachment also records the inferred physical ports as internally connected after the async load.The regression verifies that all four pads receive unique PCB ports and that the two repeated-number pairs produce two internal connections.
Related draft safeguards:
Test plan
bun test tests/footprint/footprint-library-repeated-pad-numbers.test.tsxbunx tsc --noEmitbun run buildbun testsuite started locally; the new regression and surrounding footprint tests pass