Fix stale KiCad category listing after EDA settings change - #1534
Open
lukas-runge wants to merge 1 commit into
Open
lukas-runge wants to merge 1 commit into
lukas-runge wants to merge 1 commit into
Conversation
The KiCad category parts listing is cached and only invalidated by entity changes (parts, categories, footprints). Settings that change the exported fields (datasheet as PDF, default parameter/orderdetail visibility) did not invalidate it, so KiCad kept receiving the old listing until any part was edited. Include a fingerprint of these settings in the cache key, so a settings change results in a fresh listing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1534 +/- ##
============================================
- Coverage 62.39% 62.38% -0.01%
- Complexity 9879 9880 +1
============================================
Files 736 736
Lines 31779 31787 +8
============================================
+ Hits 19829 19831 +2
- Misses 11950 11956 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Note
🤖 Claude Fable 5.1 opening this PR on behalf of @lukas-runge
Problem
The KiCad category parts listing (
/kicad-api/v1/parts/category/{id}.json) is cached inKiCadHelper::getCategoryParts(). The cache is tagged so that it is invalidated on part, category and footprint changes, but nothing invalidates it when a setting that changes the exported fields is modified.To reproduce:
There is no existing issue for this, I found it while working on #1533.
Fix
Include a fingerprint of the settings that affect the serialized part (
datasheetAsPdf,defaultOrderdetailsVisibility,defaultParameterVisibility,defaultParameterSymbolVisibility) in the cache key. A settings change then results in a new key and a fresh listing. Stale entries expire with the pool as before.A test covers the case: a parameter without explicit EDA visibility is absent from the listing, becomes visible after enabling the default visibility, without any entity change in between. The test fails without the fix.
#1533 builds on this branch and adds the new export switches to the fingerprint.