Skip to content

fix: only initialize NOT_READY providers #507

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

Merged
merged 5 commits into from
Jul 31, 2023
Merged

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Jul 26, 2023

See here. We should only run initialize if ProviderStatus is NOT_READY to prevent duplicate calls to initialize, as we Java and Go.

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, GoFF provider and the config-cat could be impacted. I created issues for these:

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.

@thomaspoignant
Copy link
Member

Hey, just wondering, do we already have a provider that implement the correct behavior?

Copy link
Member

@lukas-reining lukas-reining left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good and the logged warning makes sense.

@toddbaert toddbaert force-pushed the fix/only-init-not-ready branch from 0eb553f to c6cbe04 Compare July 26, 2023 21:00
@toddbaert
Copy link
Member Author

Hey, just wondering, do we already have a provider that implement the correct behavior?

@thomaspoignant the launchdarkly provider does: https://github.com/open-feature/js-sdk-contrib/blob/main/libs/providers/launchdarkly-client/src/lib/launchdarkly-client-provider.ts#L96-L99.

So does the in-progress implementation of flagd-js-server: open-feature/js-sdk-contrib#484

@toddbaert toddbaert force-pushed the fix/only-init-not-ready branch from c648f41 to 7b6ab22 Compare July 27, 2023 13:43
@toddbaert
Copy link
Member Author

toddbaert commented Jul 27, 2023

This is fixed in all the providers I know needed to be updated.

I will merge this in the next few days and release the artifact as our first non-experimental version if that's fine with you all.

cc @thomaspoignant @beeme1mr @lukas-reining

toddbaert pushed a commit that referenced this pull request Jul 31, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.0.10](shared-v0.0.9...shared-v0.0.10)
(2023-07-31)


### Bug Fixes

* only initialize NOT_READY providers
([#507](#507))
([5e320ae](5e320ae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@thomaspoignant thomaspoignant deleted the fix/only-init-not-ready branch July 31, 2023 13:45
toddbaert added a commit that referenced this pull request Jul 31, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.3.11](web-sdk-v0.3.10-experimental...web-sdk-v0.3.11)
(2023-07-31)


### Bug Fixes

* only initialize NOT_READY providers
([#507](#507))
([5e320ae](5e320ae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Signed-off-by: Todd Baert <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Todd Baert <[email protected]>
beeme1mr pushed a commit that referenced this pull request Aug 7, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.4.2](js-sdk-v1.4.1...js-sdk-v1.4.2)
(2023-08-07)


### Bug Fixes

* only initialize NOT_READY providers
([#507](#507))
([5e320ae](5e320ae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] client and server SDKs both initialize providers regardless of status.
4 participants