Skip to content

Commit 80d5edd

Browse files
Merge branch 'main' into upgrade-node-fetch-v3
2 parents 88111db + eddf057 commit 80d5edd

21 files changed

+577
-202
lines changed

.github/workflows/ci-cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2626

2727
- name: Install Redis
2828
run: |
@@ -33,7 +33,7 @@ jobs:
3333
run: redis-cli ping
3434

3535
- name: Setup Node.js
36-
uses: actions/setup-node@v4
36+
uses: actions/setup-node@v6
3737
with:
3838
node-version: 'lts/*'
3939
cache: 'npm'
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Store assets
6060
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v5
6262
with:
6363
name: assets
6464
path: umd/
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Download assets
83-
uses: actions/download-artifact@v4
83+
uses: actions/download-artifact@v6
8484
with:
8585
name: assets
8686
path: umd
@@ -119,7 +119,7 @@ jobs:
119119

120120
steps:
121121
- name: Download assets
122-
uses: actions/download-artifact@v4
122+
uses: actions/download-artifact@v6
123123
with:
124124
name: assets
125125
path: umd

.github/workflows/sonar-scan.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Set up Node.js
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
2424
with:
2525
node-version: 'lts/*'
2626
cache: 'npm'
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: SonarQube Scan (Push)
3838
if: github.event_name == 'push'
39-
uses: SonarSource/sonarcloud-github-action@v1.6
39+
uses: SonarSource/sonarqube-scan-action@v6
4040
env:
4141
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
4242
with:
@@ -47,9 +47,10 @@ jobs:
4747
-Dsonar.projectKey=${{ github.event.repository.name }}
4848
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
4949
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
50+
5051
- name: SonarQube Scan (Pull Request)
5152
if: github.event_name == 'pull_request'
52-
uses: SonarSource/sonarcloud-github-action@v1.6
53+
uses: SonarSource/sonarqube-scan-action@v6
5354
env:
5455
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
5556
with:

CHANGES.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
11.8.0 (October XX, 2025)
2-
- Updated @splitsoftware/splitio-commons package to version 2.8.0, which updates the SDK’s initial synchronization in Node.js (server-side) to use the `startup.requestTimeoutBeforeReady` and `startup.retriesOnFailureBeforeReady` options to control the timeout and retry behavior of segment requests.
1+
2+
11.9.1 (December XX, 2025)
33
- Updated node-fetch to version 3.3.2, which fixes some issues with the Fetch API implementation.
44

5+
11.9.0 (November 26, 2025)
6+
- Updated @splitsoftware/splitio-commons package to version 2.9.0, which:
7+
- updates the SDK’s initial synchronization in Node.js (server-side) to use the `startup.requestTimeoutBeforeReady` and `startup.retriesOnFailureBeforeReady` options to control the timeout and retry behavior of segment requests.
8+
- updates the order of storage operations to prevent inconsistent states when using the `LOCALSTORAGE` storage type and the browser’s `localStorage` fails due to quota limits.
9+
10+
11.8.0 (October 30, 2025)
11+
- 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.
12+
- Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
13+
- 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.
14+
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
15+
- Updated @splitsoftware/splitio-commons package to version 2.8.0.
16+
517
11.7.1 (October 8, 2025)
618
- 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.
719

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: 37 additions & 33 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.2-rc.1",
3+
"version": "11.9.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.2-rc.0",
41+
"@splitsoftware/splitio-commons": "2.9.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)