Repository navigation
Conversation
seanogdev
marked this pull request as ready for review
November 25, 2026 12:20
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 898a851. Configure here.
Contributor
|
Thanks for the contribution @seanogdev - per my comment in #2250 I'll hold off on doing a deep review until the SDK team aligns on what direction we want to take this.
|
Author
|
No worries at all ! Thanks for being so responsive |
This branch has not been deployed
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
Closes #2250. A cache hit fires
change, a miss fires nothing. Now both report:waitForCachebelongs to the latestidentifycall and never rejects. Anidentifycalled beforestartreturns before it takes a lookup id, so it does not settle waiters; they wait for the first real identify. Exposed on browser, node-client, Electron (main and renderer) and the React no-op client. Svelte's restricted proxy has noon, so it is unchanged.Evidence
LDClientImpl.cacheloaded.test.tsMerge Danger
Door: one-way once released
waitForCacheandcacheLoadedbecome public API.Blast Radius: additive
No existing behavior changes. TypeScript code that implements
LDClientby hand (custom mocks, wrappers) must addwaitForCache.Note
Overview
Adds
waitForCache()and acacheLoadedevent so apps know when anidentifyfinishes reading persisted flags, including cache misses (previously only hits surfaced indirectly via flag changes).LDCacheLookupResult({ hit: boolean }) is wired through sharedLDClientImpl: eachidentifygets a lookup id,cacheLoadedsettles waiters, and identifies that skip the cache (bootstrap, validation failures, etc.) resolve with{ hit: false }without hanging.DataManager.loadCachedcentralizes cache reads and emitscacheLoaded; the FDv2 path reports viaonCacheLoadedon cache initializers (once per identify, including mode switches).waitForCacheis forwarded on browser, node-client, Electron (main IPC + renderer bridge), and React no-op/mocks; exports and jest tooling mocks updated. Extensive tests cover ordering, concurrent identifies, and bootstrap-skipped cache.Reviewed by Cursor Bugbot for commit 67eb152. Bugbot is set up for automated code reviews on this repo. Configure here.