Skip to content

fix: disable cache was not working#1187

Merged
joker23 merged 1 commit into
mainfrom
skz/sdk-2023/disable-cache
Mar 16, 2026
Merged

fix: disable cache was not working#1187
joker23 merged 1 commit into
mainfrom
skz/sdk-2023/disable-cache

Conversation

@joker23

@joker23 joker23 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

sdk-2023

Describe the solution you've provided

  • added an disableCache option
  • fixed the overall cache pruning behavior

BEGIN_COMMIT_OVERRIDE
fix: Max cached context enforcement wasn't working for 0.
feat: Add explicit disableCache setting.
END_COMMIT_OVERRIDE


Note

Medium Risk
Changes persistent flag caching behavior (read/write and eviction) and introduces a new disableCache option, which can affect offline fallback/initialization latency if misconfigured. Logic is covered by new unit tests but touches core persistence paths.

Overview
Fixes persistent flag caching so it can be explicitly disabled via a new disableCache option (plumbed through LDOptionsConfigurationLDClientImplDefaultFlagManagerFlagPersistence) and validated in configuration parsing.

Updates FlagPersistence to skip all cache reads/writes when disableCache is true or maxCachedContexts <= 0, while still pruning/clearing previously cached entries and ensuring pruned contexts (including equal-timestamp edge cases) are not re-written. Adds targeted tests covering maxCachedContexts=0, disableCache=true, and pruning behavior.

Written by Cursor Bugbot for commit 431fce0. This will update automatically on new commits. Configure here.


Open with Devin

@joker23

joker23 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@joker23 joker23 force-pushed the skz/sdk-2023/disable-cache branch from 431fce0 to 816c470 Compare March 13, 2026 21:44
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25566 bytes
Compressed size limit: 26000
Uncompressed size: 125383 bytes

@github-actions

github-actions Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 172611 bytes
Compressed size limit: 200000
Uncompressed size: 802217 bytes

@github-actions

github-actions Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 22203 bytes
Compressed size limit: 24000
Uncompressed size: 115238 bytes

@joker23 joker23 force-pushed the skz/sdk-2023/disable-cache branch from 816c470 to 6124cc1 Compare March 13, 2026 22:08
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 24537 bytes
Compressed size limit: 25000
Uncompressed size: 85098 bytes

*
* @defaultValue false
*/
disableCache?: boolean;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to separate this one out for a feature release?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could put:

BEGIN_COMMIT_OVERRIDE
fix: Max cached context enforcement wasn't working for 0.
feat: Add explicit disableCache setting.
END_COMMIT_OVERRIDE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably want to use the disable cache setting in gonfalon as well.

@joker23 joker23 marked this pull request as ready for review March 13, 2026 23:00
@joker23 joker23 requested a review from a team as a code owner March 13, 2026 23:00

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@joker23 joker23 merged commit 6be89dd into main Mar 16, 2026
43 checks passed
@joker23 joker23 deleted the skz/sdk-2023/disable-cache branch March 16, 2026 18:03
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