feat(cache): per-breaker persistent stale ceiling#1699
Open
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
Open
feat(cache): per-breaker persistent stale ceiling#1699NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
NewCoder3294 wants to merge 1 commit intokoala73:mainfrom
Conversation
The global PERSISTENT_STALE_CEILING_MS (24h) is too permissive for time-sensitive data like CII risk scores. This adds an optional persistentStaleCeilingMs to CircuitBreakerOptions so individual breakers can override the global default during persistent cache hydration. Risk Scores breaker now uses LS_MAX_STALENESS_MS (1h) to align the IndexedDB persistent ceiling with the existing localStorage staleness limit from PR koala73#1320. Closes koala73#1326 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@NewCoder3294 is attempting to deploy a commit to the Elie Team on Vercel. A member of the Team first needs to authorize it. |
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
persistentStaleCeilingMstoCircuitBreakerOptionsso individual breakers can override the global 24hPERSISTENT_STALE_CEILING_MSduring IndexedDB hydrationLS_MAX_STALENESS_MS(1h) to align the persistent ceiling with the localStorage staleness limit from PR fix(cache): align CDN and client TTLs with freshness thresholds #1320Changes
src/utils/circuit-breaker.ts— new option field, private instance field, used inhydratePersistentCache()src/services/cached-risk-scores.ts— passespersistentStaleCeilingMs: LS_MAX_STALENESS_MStests/circuit-breaker-persistent-stale-ceiling.test.mts— 39 tests (static analysis, behavioral, edge cases, concurrency, encapsulation)Test plan
cacheTtlMs=0andpersistCache=false, multi-breaker isolation, concurrent execution, and encapsulationCloses #1326
🤖 Generated with Claude Code