state of the this.ready promise cannot be resolved synchronously
readyEventEmitted is not set until toggles are received from the server
and that made isReady() hard to implement.
Previously, the SDK wouldn’t be “ready” if it only bootstrapped, but the attempt to fetch flags failed. Now, we set the SDK to ready both when it’s bootstrapped and when you successfully fetch flags; whichever comes first. Otherwise, the existing functionality hasn’t changed. Essentially, what you’re doing here is adding a separate variable to track flag fetch status, making readyEventEmitted more accurately do what it says
About the changes
When bootstrapping there is an edge case when:
this.ready
promise cannot be resolved synchronouslyreadyEventEmitted
is not set until toggles are received from the serverand that made
isReady()
hard to implement.Previously, the SDK wouldn’t be “ready” if it only bootstrapped, but the attempt to fetch flags failed. Now, we set the SDK to ready both when it’s bootstrapped and when you successfully fetch flags; whichever comes first. Otherwise, the existing functionality hasn’t changed. Essentially, what you’re doing here is adding a separate variable to track flag fetch status, making readyEventEmitted more accurately do what it says