Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only initialize NOT_READY providers (#507)
See here. We should only run initialize if `ProviderStatus` is `NOT_READY` to prevent duplicate calls to `initialize`, as we [Java](https://github.com/open-feature/java-sdk/blob/main/src/main/java/dev/openfeature/sdk/ProviderRepository.java#L107-L108) and [Go](https://github.com/open-feature/go-sdk/blob/main/pkg/openfeature/api.go#L173). Most of this is test and formatting changes (I had to update the tests not to use the same object literal). The import change is the single line here. Note: it's likely this will break _some_ providers that didn't implement `status`. I think the [flagd web provider](https://github.com/open-feature/js-sdk-contrib/blob/main/libs/providers/flagd-web/src/lib/flagd-web-provider.ts), [GoFF](https://github.com/open-feature/js-sdk-contrib/blob/main/libs/providers/go-feature-flag/src/lib/go-feature-flag-provider.ts) provider and the [config-cat](https://github.com/open-feature/js-sdk-contrib/blob/main/libs/providers/config-cat/src/lib/config-cat-provider.ts) could be impacted. I created issues for these: - open-feature/js-sdk-contrib#488 - open-feature/js-sdk-contrib#489 - open-feature/js-sdk-contrib#490 Fixes: #505 I've also removed all the `setTimeouts` in our test suite. Everything is working "properly" now with plain events, since all flagd providers are fully updated. --------- Signed-off-by: Todd Baert <[email protected]>
- Loading branch information