Skip to content
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

fix: ready state when bootstrapping #218

Merged
merged 3 commits into from
Jun 26, 2024
Merged

fix: ready state when bootstrapping #218

merged 3 commits into from
Jun 26, 2024

Conversation

Tymek
Copy link
Member

@Tymek Tymek commented Jun 25, 2024

About the changes

When bootstrapping there is an edge case when:

  • 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

@Tymek Tymek marked this pull request as draft June 25, 2024 13:37
@Tymek Tymek marked this pull request as ready for review June 25, 2024 13:45
@Tymek Tymek merged commit de95fe4 into main Jun 26, 2024
3 checks passed
@Tymek Tymek deleted the fix/ready-state branch June 26, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants