Skip to content

Version the cache keys of the info provider DTOs - #1530

Merged
jbtronics merged 1 commit into
Part-DB:masterfrom
killecaptron:info-provider-cache-version
Sep 12, 2026
Merged

jbtronics merged 1 commit into
Part-DB:masterfrom
killecaptron:info-provider-cache-version

Conversation

@killecaptron

Copy link
Copy Markdown
Contributor

The info provider system caches the DTOs it received from a provider as serialized objects, in a cache pool which is not part of the cache directory and therefore survives an update of Part-DB.

Whenever a DTO class gains a property, unserializing an object which was cached by an older version leaves that property uninitialized, so the first access to it fails with a typed property error until the cache happens to expire (up to four days later).

Add a version marker to every cache key of a DTO, which has to be increased whenever the structure of the DTOs changes: old entries are then simply never read again and expire on their own.

The info provider system caches the DTOs it received from a provider as
serialized objects, in a cache pool which is not part of the cache
directory and therefore survives an update of Part-DB.

Whenever a DTO class gains a property, unserializing an object which was
cached by an older version leaves that property uninitialized, so the
first access to it fails with a typed property error until the cache
happens to expire (up to four days later).

Add a version marker to every cache key of a DTO, which has to be
increased whenever the structure of the DTOs changes: old entries are
then simply never read again and expire on their own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.37%. Comparing base (0f0ee60) to head (276370b).

Files with missing lines Patch % Lines
...es/InfoProviderSystem/Providers/CanopyProvider.php 0.00% 2 Missing ⚠️
.../InfoProviderSystem/Providers/OctopartProvider.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1530      +/-   ##
============================================
- Coverage     62.39%   62.37%   -0.02%     
  Complexity     9879     9879              
============================================
  Files           736      736              
  Lines         31779    31779              
============================================
- Hits          19829    19823       -6     
- Misses        11950    11956       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbtronics

Copy link
Copy Markdown
Member

Looks good. Thanks.

@jbtronics
jbtronics merged commit d12153a into Part-DB:master Sep 12, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants