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
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,11 @@
3
3
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
4
4
- Bugfixing - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
5
5
- BREAKING CHANGES:
6
-
- Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations.
7
6
- Updated default flag spec version to 1.2.
8
7
- Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.
9
8
- Removed support for MY_SEGMENTS_UPDATE and MY_SEGMENTS_UPDATE_V2 notification types, as they are replaced by MEMBERSHIPS_MS_UPDATE and MEMBERSHIPS_LS_UPDATE notification types.
9
+
- Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations.
10
+
- Bugfixing - Fixed an issue with the `ready` method that caused the returned promise to hang on async/await syntax if it was rejected. The fix implies that the promise rejection must be handled by the user.
10
11
11
12
1.17.0 (September 6, 2024)
12
13
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
expect(loggerMock.warn).toBeCalledWith(CLIENT_NO_LISTENER);// We would get the warning if the SDK get\'s ready before attaching any callbacks to ready promise.
expect(loggerMock.warn).toBeCalledWith(CLIENT_NO_LISTENER);// We should get a warning if the SDK get's ready before calling the ready method or attaching a listener to the ready event
expect(loggerMock.error).lastCalledWith('Split SDK has emitted SDK_READY_TIMED_OUT event.');// If we don\'t handle a new .ready() rejected promise, an error is logged.
expect(error.message).toBe('Split SDK has emitted SDK_READY_TIMED_OUT event.');
320
-
expect(loggerMock.error).toBeCalledTimes(2);// If we provide an onRejected handler, even chaining several onFulfilled handlers, the error is not logged.
@@ -91,34 +78,19 @@ export function sdkReadinessManagerFactory(
91
78
SDK_UPDATE,
92
79
SDK_READY_TIMED_OUT,
93
80
},
94
-
/**
95
-
* Returns a promise that will be resolved once the SDK has finished loading (SDK_READY event emitted) or rejected if the SDK has timedout (SDK_READY_TIMED_OUT event emitted).
96
-
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, calling the `ready` method after the
97
-
* SDK had timed out will return a new promise that should eventually resolve if the SDK gets ready.
98
-
*
99
-
* Caveats: the method was designed to avoid an unhandled Promise rejection if the rejection case is not handled, so that `onRejected` handler is optional when using promises.
100
-
* However, when using async/await syntax, the rejection should be explicitly propagated like in the following example:
* Returns a promise that will be resolved once the SDK has finished loading (SDK_READY event emitted) or rejected if the SDK has timedout (SDK_READY_TIMED_OUT event emitted).
394
-
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, calling the `ready` method after the
395
-
* SDK had timed out will return a new promise that should eventually resolve if the SDK gets ready.
396
-
*
397
-
* Caveats: the method was designed to avoid an unhandled Promise rejection if the rejection case is not handled, so that `onRejected` handler is optional when using promises.
398
-
* However, when using async/await syntax, the rejection should be explicitly propagated like in the following example:
* Returns a promise that resolves once the SDK has finished loading (`SDK_READY` event emitted) or rejected if the SDK has timedout (`SDK_READY_TIMED_OUT` event emitted).
394
+
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, the `ready` method will return a resolved promise once the SDK is ready.
395
+
* You must handle the promise rejection to avoid an unhandled promise rejection error, or you can set the `startup.readyTimeout` configuration option to 0 to avoid the timeout and thus the rejection.
0 commit comments