Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3923d91
[FME-10568] update js commons and add fallback treatment e2e tests
ZamoraEmmanuel Oct 24, 2025
cb8214a
fix version
ZamoraEmmanuel Oct 24, 2025
3fe6120
fix version test
ZamoraEmmanuel Oct 24, 2025
b28c3f4
remove timeout
ZamoraEmmanuel Oct 24, 2025
355cb94
Update tests
EmilianoSanchez Oct 15, 2025
5857e2d
Move test to the end
ZamoraEmmanuel Oct 27, 2025
ea6bff7
Move tests to the top
ZamoraEmmanuel Oct 27, 2025
23521c4
Move test
ZamoraEmmanuel Oct 27, 2025
2b26ced
Fix test
ZamoraEmmanuel Oct 27, 2025
d842d6c
Move telemery tests to bottom
ZamoraEmmanuel Oct 27, 2025
2acd976
Move telemetry test
ZamoraEmmanuel Oct 27, 2025
1d63122
Fix fallback treatment localhost test
EmilianoSanchez Oct 27, 2025
5d621b1
Update JS-commons
EmilianoSanchez Oct 27, 2025
105e4fc
Merge pull request #898 from splitio/readiness-sdk-ready-from-cache
EmilianoSanchez Oct 27, 2025
50bee00
Merge branch 'fallback-treatment' into fme-10568
EmilianoSanchez Oct 27, 2025
8fb634e
rc
EmilianoSanchez Oct 28, 2025
910e0ca
Test update
EmilianoSanchez Oct 28, 2025
39c9d8a
Use getStatus
EmilianoSanchez Oct 28, 2025
18235b7
fix test
EmilianoSanchez Oct 28, 2025
c1bdce1
Update ts-test
EmilianoSanchez Oct 29, 2025
d40d081
add ts-tests, update commons to 2.7.9-rc.3
ZamoraEmmanuel Oct 29, 2025
98d95f2
Merge pull request #897 from splitio/fme-10568
ZamoraEmmanuel Oct 29, 2025
1787f07
rc
EmilianoSanchez Oct 30, 2025
7495443
stable version
EmilianoSanchez Oct 30, 2025
34fa535
Merge pull request #899 from splitio/fallback-treatment
EmilianoSanchez Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
11.8.0 (October 30, 2025)
- 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.
- Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
- 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.
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
- Updated @splitsoftware/splitio-commons package to version 2.8.0.

11.7.1 (October 8, 2025)
- 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.

Expand Down
2 changes: 1 addition & 1 deletion karma/e2e.online.karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const assign = require('lodash/assign');

module.exports = function(config) {
module.exports = function (config) {
'use strict';

config.set(assign({}, require('./config'), {
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio",
"version": "11.7.1",
"version": "11.8.0",
"description": "Split SDK",
"files": [
"README.md",
Expand Down Expand Up @@ -38,7 +38,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@splitsoftware/splitio-commons": "2.7.1",
"@splitsoftware/splitio-commons": "2.8.0",
"bloom-filters": "^3.0.4",
"ioredis": "^4.28.0",
"js-yaml": "^3.13.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ export default function (fetchMock, assert) {
t.end();
});
client.once(client.Event.SDK_READY_FROM_CACHE, () => {
t.true(client.__getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY');
t.true(client.getStatus().isReady, 'Client should emit SDK_READY_FROM_CACHE alongside SDK_READY');
});

client.on(client.Event.SDK_READY, () => {
t.true(client.__getStatus().isReadyFromCache, 'Client should emit SDK_READY and it should be ready from cache');
t.true(client.getStatus().isReadyFromCache, 'Client should emit SDK_READY and it should be ready from cache');
});
client2.on(client.Event.SDK_READY, () => {
t.true(client2.__getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
t.true(client2.getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
});
client3.on(client.Event.SDK_READY, () => {
t.true(client2.__getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
t.true(client2.getStatus().isReadyFromCache, 'Non-default client should emit SDK_READY and it should be ready from cache');
});

});
Expand Down Expand Up @@ -168,20 +168,20 @@ export default function (fetchMock, assert) {
t.true(Date.now() - startTime >= 400, 'It should emit SDK_READY too but after syncing with the cloud.');
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client.ready().then(() => {
client.whenReady().then(() => {
t.true(Date.now() - startTime >= 400, 'It should resolve ready promise after syncing with the cloud.');
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client2.on(client2.Event.SDK_READY, () => {
t.true(Date.now() - startTime >= 700, 'It should emit SDK_READY too but after syncing with the cloud.');
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client2.ready().then(() => {
client2.whenReady().then(() => {
t.true(Date.now() - startTime >= 700, 'It should resolve ready promise after syncing with the cloud.');
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client3.on(client3.Event.SDK_READY, () => {
client3.ready().then(() => {
client3.whenReady().then(() => {
t.true(Date.now() - startTime >= 1000, 'It should resolve ready promise after syncing with the cloud.');
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');

Expand All @@ -196,7 +196,7 @@ export default function (fetchMock, assert) {
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client3.on(client3.Event.SDK_READY_TIMED_OUT, () => {
client3.ready().catch(() => {
client3.whenReady().catch(() => {
t.true(Date.now() - startTime >= 850, 'It should reject ready promise before syncing memberships data with the cloud.');
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with memberships data from cache.');
});
Expand Down Expand Up @@ -280,20 +280,20 @@ export default function (fetchMock, assert) {
t.true(nearlyEqual(Date.now() - startTime, CLIENT_READY_MS), 'It should emit SDK_READY after syncing with the cloud.');
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client.ready().then(() => {
client.whenReady().then(() => {
t.true(nearlyEqual(Date.now() - startTime, CLIENT_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
t.equal(client.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client2.on(client2.Event.SDK_READY, () => {
t.true(nearlyEqual(Date.now() - startTime, CLIENT2_READY_MS), 'It should emit SDK_READY after syncing with the cloud.');
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client2.ready().then(() => {
client2.whenReady().then(() => {
t.true(nearlyEqual(Date.now() - startTime, CLIENT2_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
t.equal(client2.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
});
client3.on(client3.Event.SDK_READY, () => {
client3.ready().then(() => {
client3.whenReady().then(() => {
t.true(nearlyEqual(Date.now() - startTime, CLIENT3_READY_MS), 'It should resolve ready promise after syncing with the cloud.');
t.equal(client3.getTreatment('always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');

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

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

await client.ready();
await client.whenReady();

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');

Expand Down Expand Up @@ -400,7 +400,7 @@ export default function (fetchMock, assert) {
manager = splitio.manager();

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

await new Promise(res => client.once(client.Event.SDK_READY, res));
Expand Down
Loading