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
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
1.6.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.
3
+
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
4
+
- Updated @splitsoftware/splitio-commons package to version 2.8.0.
5
+
1
6
1.5.1 (October 8, 2025)
2
7
- Bugfix - Updated @splitsoftware/splitio-commons package to version 2.7.1, which fixes the `debug` option to support log levels when the `logger` option is used.
assert.equal(client.getTreatment('hierarchical_splits_test'),'control','We should get control if client is not ready.');
34
-
assert.true(consoleSpy.log.calledWithExactly('[WARN] splitio => getTreatment: the SDK is not ready, results may be incorrect for feature flag hierarchical_splits_test. Make sure to wait for SDK readiness before using this method.'),'Telling us that calling getTreatment would return CONTROL since SDK is not ready at this point.');
34
+
assert.true(consoleSpy.log.calledWithExactly('[WARN] splitio => getTreatment: the SDK is not ready to evaluate. Results may be incorrect for feature flag hierarchical_splits_test. Make sure to wait for SDK readiness before using this method.'),'Telling us that calling getTreatment would return CONTROL since SDK is not ready at this point.');
@@ -421,7 +421,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
421
421
// `ready` is called immediately. Thus, the 'reject' callback is expected to be called in 0.15 seconds aprox.
422
422
setTimeout(()=>{
423
423
consttStart=Date.now();
424
-
client.ready()
424
+
client.whenReady()
425
425
.then(()=>{
426
426
t.fail('### SDK IS READY - not TIMED OUT when it should.');
427
427
})
@@ -436,7 +436,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
436
436
// `ready` is called in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
437
437
setTimeout(()=>{
438
438
consttStart=Date.now();
439
-
manager.ready()
439
+
manager.whenReady()
440
440
.then(()=>{
441
441
t.fail('### SDK IS READY - not TIMED OUT when it should.');
442
442
})
@@ -451,7 +451,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
451
451
// `ready` is called in 0.25 seconds, right after the promise is resolved (0.2 secs). Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
452
452
setTimeout(()=>{
453
453
consttStart=Date.now();
454
-
manager.ready()
454
+
manager.whenReady()
455
455
.then(()=>{
456
456
t.pass('### SDK IS READY - retry attempt finishes before the requestTimeoutBeforeReady limit');
457
457
assertGetTreatmentWhenReady(t,client);
@@ -465,7 +465,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
465
465
})
466
466
.then(()=>{
467
467
client.destroy().then(()=>{
468
-
client.ready()
468
+
client.whenReady()
469
469
.then(()=>{
470
470
t.pass('### SDK IS READY - the promise remains resolved after client destruction.');
client.whenReadyFromCache().then((isReady)=>t.true(isReady,'SDK IS READY (& READY FROM CACHE) - Should resolve')).catch(()=>t.fail('SDK TIMED OUT - Should not reject'));
525
525
526
526
assertGetTreatmentWhenReady(t,client);
527
-
t.true(consoleSpy.log.calledWithExactly('[WARN] splitio => 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.'),
528
-
'Warning that there are not listeners for SDK_READY event');
529
527
530
528
// assert error messages when adding event listeners after SDK has already triggered them
531
529
consoleSpy.log.resetHistory();
@@ -540,15 +538,15 @@ export default function readyPromiseAssertions(fetchMock, assert) {
t.false(consoleSpy.log.calledWithExactly('[WARN] splitio => 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.'),
541
+
t.false(consoleSpy.log.calledWithExactly('[WARN] splitio => 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.'),
t.true(consoleSpy.log.calledWithExactly('[WARN] splitio => 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.'),
546
+
t.true(consoleSpy.log.calledWithExactly('[WARN] splitio => 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.'),
0 commit comments