Skip to content

Commit 88be475

Browse files
rc
1 parent 34e0170 commit 88be475

File tree

8 files changed

+80
-21
lines changed

8 files changed

+80
-21
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
11.5.0 (August XX, 2025)
1+
11.5.0 (September 9, 2025)
22
- Added `factory.getRolloutPlan()` method for standalone server-side SDKs, which returns the rollout plan snapshot from the storage.
33
- Added `initialRolloutPlan` configuration option for standalone client-side SDKs, which allows preloading the SDK storage with a snapshot of the rollout plan.
44

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.5.0-rc.0",
3+
"version": "11.5.0-rc.1",
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.5.0-rc.0",
41+
"@splitsoftware/splitio-commons": "2.5.0-rc.1",
4242
"bloom-filters": "^3.0.4",
4343
"ioredis": "^4.28.0",
4444
"js-yaml": "^3.13.1",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import membershipsNicolas from '../mocks/[email protected]';
1010

1111
const DEFAULT_CACHE_EXPIRATION_IN_MILLIS = 864000000; // 10 days
1212

13-
const alwaysOnSplitInverted = JSON.stringify({
13+
export const alwaysOnSplitInverted = JSON.stringify({
1414
'environment': null,
1515
'trafficTypeId': null,
1616
'trafficTypeName': null,
@@ -491,7 +491,7 @@ export default function (fetchMock, assert) {
491491
});
492492
});
493493

494-
assert.test(t => { // Testing when we start with initial rollout plan data and MEMORY storage type (is ready from cache immediately)
494+
assert.test(t => { // Testing when we start with initial rollout plan data and sync storage type (is ready from cache immediately)
495495
const testUrls = {
496496
sdk: 'https://sdk.baseurl/readyFromCacheWithInitialRolloutPlan',
497497
events: 'https://events.baseurl/readyFromCacheWithInitialRolloutPlan'
@@ -509,7 +509,7 @@ export default function (fetchMock, assert) {
509509
const splitio = SplitFactory({
510510
...baseConfig,
511511
storage: {
512-
type: 'MEMORY',
512+
type: 'MEMORY', // LOCALSTORAGE is supported too
513513
},
514514
urls: testUrls,
515515
initialRolloutPlan: {

src/__tests__/nodeSuites/evaluations.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ export default async function (config, key, assert) {
285285
const expectedRolloutPlan = {
286286
splitChanges: splitChangesMock1,
287287
segmentChanges: [
288-
{ name: 'employees', added: [], removed: [], till: 1 },
289-
{ name: 'splitters', added: [], removed: [], till: 1 },
290-
{ name: 'developers', added: [], removed: [], till: 1 },
291-
{ name: 'segment_excluded_by_rbs', added: ['[email protected]'], removed: [], till: 1 }
288+
{ name: 'employees', added: [], removed: [], till: 1, since: -1 },
289+
{ name: 'splitters', added: [], removed: [], till: 1, since: -1 },
290+
{ name: 'developers', added: [], removed: [], till: 1, since: -1 },
291+
{ name: 'segment_excluded_by_rbs', added: ['[email protected]'], removed: [], till: 1, since: -1 }
292292
],
293293
memberships: { '[email protected]': { ms: { k: [{ n: 'segment_excluded_by_rbs' }] }, ls: { k: [] } } }
294294
};

src/__tests__/nodeSuites/readiness.spec.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SplitFactory } from '../../';
22

33
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';
44
import splitChangesMock2 from '../mocks/splitchanges.since.1457552620999.json';
5+
import { alwaysOnSplitInverted } from '../browserSuites/ready-from-cache.spec';
56

67
const readyTimeout = 0.1;
78

@@ -55,4 +56,62 @@ export default function (fetchMock, assert) {
5556
});
5657
});
5758

59+
assert.test(t => { // Testing when we start with initial rollout plan data (is ready from cache immediately)
60+
const testUrls = {
61+
sdk: 'https://sdk.baseurl/readinessSuite2',
62+
events: 'https://events.baseurl/readinessSuite2'
63+
};
64+
65+
fetchMock.getOnce(testUrls.sdk + '/splitChanges?s=1.3&since=25&rbSince=-1', { status: 200, body: { ff: { ...splitChangesMock1.ff, s: 25 } } });
66+
fetchMock.getOnce(testUrls.sdk + '/segmentChanges/employees?since=100', { status: 200, body: { name: 'employees', added: [], removed: [], since: 100, till: 100 } });
67+
fetchMock.getOnce(testUrls.sdk + '/segmentChanges/splitters?since=-1', { status: 200, body: { name: 'splitters', added: [], removed: [], since: -1, till: 100 } });
68+
fetchMock.getOnce(testUrls.sdk + '/segmentChanges/splitters?since=100', { status: 200, body: { name: 'splitters', added: [], removed: [], since: 100, till: 100 } });
69+
fetchMock.getOnce(testUrls.sdk + '/segmentChanges/developers?since=-1', { status: 200, body: { name: 'developers', added: [], removed: [], since: -1, till: 100 } });
70+
fetchMock.getOnce(testUrls.sdk + '/segmentChanges/developers?since=100', { status: 200, body: { name: 'developers', added: [], removed: [], since: 100, till: 100 } });
71+
fetchMock.postOnce(testUrls.events + '/testImpressions/bulk', 200);
72+
fetchMock.postOnce(testUrls.events + '/testImpressions/count', 200);
73+
74+
const splitio = SplitFactory({
75+
...baseConfig,
76+
urls: testUrls,
77+
initialRolloutPlan: {
78+
splitChanges: {
79+
ff: {
80+
t: 25,
81+
d: [JSON.parse(alwaysOnSplitInverted)]
82+
}
83+
},
84+
segmentChanges: [{
85+
name: 'employees', added: ['[email protected]'], removed: [], till: 100
86+
}]
87+
}
88+
});
89+
90+
const client = splitio.client();
91+
92+
t.equal(client.__getStatus().isReadyFromCache, true, 'Client is ready from cache');
93+
94+
t.equal(client.getTreatment('[email protected]', 'always_on'), 'off', 'It should evaluate treatments with data from cache. Key not in segment');
95+
t.equal(client.getTreatment('[email protected]', 'always_on'), 'on', 'It should evaluate treatments with data from cache. Key in segment');
96+
97+
client.on(client.Event.SDK_READY_TIMED_OUT, () => {
98+
t.fail('It should not timeout in this scenario.');
99+
t.end();
100+
});
101+
102+
client.on(client.Event.SDK_READY_FROM_CACHE, () => {
103+
t.fail('SDK is ready from cache immediately. SDK_READY_FROM_CACHE not emitted.');
104+
t.end();
105+
});
106+
107+
client.on(client.Event.SDK_READY, () => {
108+
t.equal(client.getTreatment('[email protected]', 'always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
109+
t.equal(client.getTreatment('[email protected]', 'always_on'), 'on', 'It should evaluate treatments with updated data after syncing with the cloud.');
110+
111+
splitio.destroy().then(() => {
112+
t.end();
113+
});
114+
});
115+
});
116+
58117
}

src/factory/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { pushManagerFactory } from '@splitsoftware/splitio-commons/src/sync/stre
44
import { pollingManagerSSFactory } from '@splitsoftware/splitio-commons/src/sync/polling/pollingManagerSS';
55
import { InRedisStorage } from '@splitsoftware/splitio-commons/src/storages/inRedis';
66
import { InMemoryStorageFactory } from '@splitsoftware/splitio-commons/src/storages/inMemory/InMemoryStorage';
7-
import { getRolloutPlan } from '@splitsoftware/splitio-commons/src/storages/dataLoader';
7+
import { getRolloutPlan } from '@splitsoftware/splitio-commons/src/storages/getRolloutPlan';
88
import { sdkManagerFactory } from '@splitsoftware/splitio-commons/src/sdkManager';
99
import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/src/sdkClient/sdkClientMethod';
1010
import { impressionObserverSSFactory } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/impressionObserverSS';

src/settings/defaults/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const packageVersion = '11.5.0-rc.0';
1+
export const packageVersion = '11.5.0-rc.1';

0 commit comments

Comments
 (0)