You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> **Medium Risk**
> Touches persistence and FDv2 data-source plumbing by adding new
cached-data paths and new storage keys, which could affect startup
behavior and cache correctness across contexts. Changes are well-covered
by new unit tests but still impact core flag loading/poll timing logic.
>
> **Overview**
> Adds an FDv2 `CacheInitializer` that loads cached flag evaluations
from persistent storage (including legacy-key fallback), returns them as
a changeSet without a selector, and supports early shutdown via
`close()`.
>
> Introduces cache “freshness” metadata: `FlagPersistence` now
writes/evicts `{contextKey}_freshness` records (timestamp + context
hash), `readFreshness` validates them, and `FDv2SourceResult.changeSet`
can carry an optional `freshness` value; also adds `calculatePollDelay`
to derive the next poll delay from freshness.
>
> Refactors/expands tests to cover the new cache initializer, freshness
persistence/eviction, and updates existing storage tests for the
additional storage writes; shared test helpers are centralized in
`flagManagerTestHelpers.ts`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ccae06f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/launchdarkly/js-core/pull/1147"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
0 commit comments