Skip to content

fix: Log the cached-data evaluation warning only once per client - #2015

Draft
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/log-cached-data-warning-once
Draft

fix: Log the cached-data evaluation warning only once per client#2015
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/log-cached-data-warning-once

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

When a variation or allFlagsState call arrives before the client has finished initializing and the feature store already holds data, the server client evaluates against that data and logs a warning. The warning is logged on every such call, so a client that is waiting on its data source while serving from a populated store (for example, a persistent store or an initializer snapshot) floods the log at the evaluation rate.

Both warnings are now logged once per client instance. A private boolean per message records that it was logged. The check and the write happen only inside the branch where the store reports initialized, so a normal evaluation does not touch them. JavaScript is single-threaded, so no synchronization is needed. Each message ends with a note that it is logged once.

The sibling messages for an uninitialized store, which return the default value or an empty state, are unchanged.

This package is shared by the Node server SDK and the edge SDKs, so all of them pick up the change.

@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: 26983 bytes
Compressed size limit: 29000
Uncompressed size: 131377 bytes

@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: 32597 bytes
Compressed size limit: 34000
Uncompressed size: 116806 bytes

@github-actions

Copy link
Copy Markdown
Contributor

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

@kinyoklion
kinyoklion force-pushed the rlamb/log-cached-data-warning-once branch from 95aca06 to 433c920 Compare September 11, 2026 22:23
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.

1 participant