Commit 5e320ae
authored
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]>1 parent 8734b77 commit 5e320ae
File tree
8 files changed
+217
-197
lines changed- packages
- client
- e2e/step-definitions
- test
- server
- e2e/step-definitions
- test
8 files changed
+217
-197
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
17 | 15 | | |
18 | | - | |
19 | | - | |
| 16 | + | |
| 17 | + | |
20 | 18 | | |
21 | 19 | | |
0 commit comments