-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
waitForInitialization
should wait until flags have been initialized
#114
Comments
The Bootstrap is intended to be generated using the same context on a server as will be evaluated on the client, and should have all the same flags as a payload that the client receives. This would typically happen immediately before initialization either via server-side rendering, or something like a payload from an authentication request. What is the use case of the bootstrap data in this situation which results in it not containing the correct flag payload? Thank you, |
It's been difficult to reproduce the exact error but I can try to describe the context around this ask. From what we've seen, when changing a flag targeting rule in the LD console, the subsequent page load often fails to evaluate the flag - returning Please correct me if I'm misinterpreting, but my hunch was given we are busting the LD server flag cache (by updating a targeting rule), the LD APIs takes longer than normal to respond and therefore the If that theory is correct then maybe having a separate method to wait until the flags have been populated by the stream, or updating The one issue with my theory is that OpenFeature only requires |
Unfortunately this isn't something we can do in our application. We are setting context using a |
There has been additional conversation outside github for this. Once further context is available the ticket should be updated. |
Based on our conversation on the CNCF Slack, I think the problem actually stems from the fact that LD Client was never timing out if it failed to connect to the server during initialization. This ultimately caused the OpenFeature provider to stall and therefore all flags evaluated to |
Is your feature request related to a problem? Please describe.
Using the SDK, we sometimes randomly run into a situation where we are evaluating a flag right after the page is loaded. In the LaunchDarkly support documentation, the
FLAG_NOT_FOUND
is caused by the cache not yet being populated by the client. From diving into the code, it appears that thewaitForInitialization
does not wait until flags have been initialized from the LD service before it resolves (only from the bootstrap).Describe the solution you'd like
waitForInitialization
should wait for flags to have been loaded from the service (in my case, the stream) before resolving.Describe alternatives you've considered
I have struggled to find any way to determine whether flags have been loaded, since all of this is abstracted away behind higher levels of the SDK.
Additional context
Add any other context about the feature request here.
The text was updated successfully, but these errors were encountered: