Skip to content

Commit 299cfc8

Browse files
Merge pull request #900 from splitio/development
Release 11.8.0
2 parents 8b17087 + 34fa535 commit 299cfc8

18 files changed

+497
-160
lines changed

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
11.8.0 (October 30, 2025)
2+
- Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
3+
- Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
4+
- 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.
5+
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
6+
- Updated @splitsoftware/splitio-commons package to version 2.8.0.
7+
18
11.7.1 (October 8, 2025)
29
- 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.
310

karma/e2e.online.karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const assign = require('lodash/assign');
22

3-
module.exports = function(config) {
3+
module.exports = function (config) {
44
'use strict';
55

66
config.set(assign({}, require('./config'), {

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio",
3-
"version": "11.7.1",
3+
"version": "11.8.0",
44
"description": "Split SDK",
55
"files": [
66
"README.md",
@@ -38,7 +38,7 @@
3838
"node": ">=14.0.0"
3939
},
4040
"dependencies": {
41-
"@splitsoftware/splitio-commons": "2.7.1",
41+
"@splitsoftware/splitio-commons": "2.8.0",
4242
"bloom-filters": "^3.0.4",
4343
"ioredis": "^4.28.0",
4444
"js-yaml": "^3.13.1",

src/__tests__/browserSuites/ready-from-cache-async-wrapper.spec.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ export default function (fetchMock, assert) {
7070
t.end();
7171
});
7272
client.once(client.Event.SDK_READY_FROM_CACHE, () => {
73-
t.true(client.__getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY');
73+
t.true(client.getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY');
7474
});
7575

7676
client.on(client.Event.SDK_READY, () => {
77-
t.true(client.__getStatus().isReadyFromCache, 'Client should emit SDK_READY and it should be ready from cache');
77+
t.true(client.getStatus().isReadyFromCache, 'Client should emit SDK_READY and it should be ready from cache');
7878
});
7979
client2.on(client.Event.SDK_READY, () => {
80-
t.true(client2.__getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
80+
t.true(client2.getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
8181
});
8282
client3.on(client.Event.SDK_READY, () => {
83-
t.true(client2.__getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
83+
t.true(client2.getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
8484
});
8585

8686
});
@@ -168,20 +168,20 @@ export default function (fetchMock, assert) {
168168
t.true(Date.now() - startTime >= 400, 'It should emit SDK_READY too but after syncing with the cloud.');
169169
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
170170
});
171-
client.ready().then(() => {
171+
client.whenReady().then(() => {
172172
t.true(Date.now() - startTime >= 400, 'It should resolve ready promise after syncing with the cloud.');
173173
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
174174
});
175175
client2.on(client2.Event.SDK_READY, () => {
176176
t.true(Date.now() - startTime >= 700, 'It should emit SDK_READY too but after syncing with the cloud.');
177177
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
178178
});
179-
client2.ready().then(() => {
179+
client2.whenReady().then(() => {
180180
t.true(Date.now() - startTime >= 700, 'It should resolve ready promise after syncing with the cloud.');
181181
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
182182
});
183183
client3.on(client3.Event.SDK_READY, () => {
184-
client3.ready().then(() => {
184+
client3.whenReady().then(() => {
185185
t.true(Date.now() - startTime >= 1000, 'It should resolve ready promise after syncing with the cloud.');
186186
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
187187

@@ -196,7 +196,7 @@ export default function (fetchMock, assert) {
196196
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
197197
});
198198
client3.on(client3.Event.SDK_READY_TIMED_OUT, () => {
199-
client3.ready().catch(() => {
199+
client3.whenReady().catch(() => {
200200
t.true(Date.now() - startTime >= 850, 'It should reject ready promise before syncing memberships data with the cloud.');
201201
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with memberships data from cache.');
202202
});
@@ -280,20 +280,20 @@ export default function (fetchMock, assert) {
280280
t.true(nearlyEqual(Date.now() - startTime, CLIENT_READY_MS), 'It should emit SDK_READY after syncing with the cloud.');
281281
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
282282
});
283-
client.ready().then(() => {
283+
client.whenReady().then(() => {
284284
t.true(nearlyEqual(Date.now() - startTime, CLIENT_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
285285
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
286286
});
287287
client2.on(client2.Event.SDK_READY, () => {
288288
t.true(nearlyEqual(Date.now() - startTime, CLIENT2_READY_MS), 'It should emit SDK_READY after syncing with the cloud.');
289289
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
290290
});
291-
client2.ready().then(() => {
291+
client2.whenReady().then(() => {
292292
t.true(nearlyEqual(Date.now() - startTime, CLIENT2_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
293293
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
294294
});
295295
client3.on(client3.Event.SDK_READY, () => {
296-
client3.ready().then(() => {
296+
client3.whenReady().then(() => {
297297
t.true(nearlyEqual(Date.now() - startTime, CLIENT3_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
298298
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
299299

@@ -310,7 +310,7 @@ export default function (fetchMock, assert) {
310310
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
311311
});
312312
client3.on(client3.Event.SDK_READY_TIMED_OUT, () => {
313-
client3.ready().catch(() => {
313+
client3.whenReady().catch(() => {
314314
t.true(Date.now() - startTime >= 850, 'It should reject ready promise before syncing memberships data with the cloud.');
315315
t.equal(client3.getTreatment('always_on'), 'control', 'It should not evaluate treatments with memberships data from cache.');
316316
});
@@ -356,10 +356,10 @@ export default function (fetchMock, assert) {
356356
let manager = splitio.manager();
357357

358358
client.once(client.Event.SDK_READY_FROM_CACHE, () => {
359-
t.true(client.__getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY, because clearOnInit is true');
359+
t.true(client.getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY, because clearOnInit is true');
360360
});
361361

362-
await client.ready();
362+
await client.whenReady();
363363

364364
t.true(console.log.calledWithMatch('clearOnInit was set and cache was not cleared in the last 24 hours. Cleaning up cache'), 'It should log a message about cleaning up cache');
365365

@@ -400,7 +400,7 @@ export default function (fetchMock, assert) {
400400
manager = splitio.manager();
401401

402402
client.once(client.Event.SDK_READY_FROM_CACHE, () => {
403-
t.true(client.__getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY, because clearOnInit is true');
403+
t.true(client.getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY, because clearOnInit is true');
404404
});
405405

406406
await new Promise(res => client.once(client.Event.SDK_READY, res));

0 commit comments

Comments
 (0)