You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
2.8.0 (October XX, 2025)
2
+
- Added `client.whenReady()` and `client.whenReadyFromCache()` methods to replace the deprecated `client.ready()` method, which has an issue causing the returned promise to hang when using async/await syntax if it was rejected.
2
3
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
[c.SUBMITTERS_PUSH_RETRY,c.LOG_PREFIX_SYNC_SUBMITTERS+'Failed to push %s, keeping data to retry on next iteration. Reason: %s.'],
16
16
// client status
17
17
[c.CLIENT_NOT_READY_FROM_CACHE,'%s: the SDK is not ready to evaluate. Results may be incorrect%s. Make sure to wait for SDK readiness before using this method.'],
18
-
[c.CLIENT_NO_LISTENER,'No listeners for SDK Readiness detected. Incorrect control treatments could have been logged if you called getTreatment/s while the SDK was not yet ready.'],
18
+
[c.CLIENT_NO_LISTENER,'No listeners for SDK_READY event detected. Incorrect control treatments could have been logged if you called getTreatment/s while the SDK was not yet synchronized with the backend.'],
19
19
// input validation
20
20
[c.WARN_SETTING_NULL,'%s: Property "%s" is of invalid type. Setting value to null.'],
21
21
[c.WARN_TRIMMING_PROPERTIES,'%s: more than 300 properties were provided. Some of them will be trimmed when processed.'],
expect(sdkReadyResolvePromiseCall[0]).toBe(SDK_READY);// A one time only subscription is on the SDK_READY event, for resolving the full blown ready promise and to check for callbacks warning.
71
-
expect(sdkReadyRejectPromiseCall[0]).toBe(SDK_READY_TIMED_OUT);// A one time only subscription is also on the SDK_READY_TIMED_OUT event, for rejecting the full blown ready promise.
72
-
expect(sdkReadyFromCacheListenersCheckCall[0]).toBe(SDK_READY_FROM_CACHE);// A one time only subscription is on the SDK_READY_FROM_CACHE event, to log the event and update internal state.
85
+
expect(sdkReadyResolvePromiseCall[0]).toBe(SDK_READY);// A one time only subscription is on the SDK_READY event
86
+
expect(sdkReadyRejectPromiseCall[0]).toBe(SDK_READY_TIMED_OUT);// A one time only subscription is also on the SDK_READY_TIMED_OUT event
87
+
expect(sdkReadyFromCacheListenersCheckCall[0]).toBe(SDK_READY_FROM_CACHE);// A one time only subscription is on the SDK_READY_FROM_CACHE event
73
88
74
89
expect(gateMock.on).toBeCalledTimes(2);// It should also add two persistent listeners
expect(loggerMock.warn).toBeCalledTimes(1);// If the SDK_READY event fires and we have no callbacks for it (neither event nor ready promise) we get a warning.
116
+
expect(loggerMock.warn).toBeCalledTimes(1);// If the SDK_READY event fires and we have no callbacks for it (neither event nor whenReady promise) we get a warning.
102
117
expect(loggerMock.warn).toBeCalledWith(CLIENT_NO_LISTENER);// Telling us there were no listeners and evaluations before this point may have been incorrect.
103
118
104
119
expect(loggerMock.info).toBeCalledTimes(1);// If the SDK_READY event fires, we get a info message.
expect(loggerMock.warn).toBeCalledWith(CLIENT_NO_LISTENER);// We should get a warning if the SDK get's ready before calling the whenReady method or attaching a listener to the ready event
* SdkReadinessManager factory, which provides the public status API of SDK clients and manager: ready promise, readiness event emitter and constants (SDK_READY, etc).
@@ -38,6 +39,8 @@ export function sdkReadinessManagerFactory(
0 commit comments