Skip to content

Commit dec6305

Browse files
Merge pull request #871 from splitio/redis_require
Update Redis require
2 parents 844c904 + 67e4039 commit dec6305

File tree

5 files changed

+28
-21
lines changed

5 files changed

+28
-21
lines changed

CHANGES.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
11.2.1 (May XX, 2025)
2+
- Updated @splitsoftware/splitio-commons package to version 2.2.1, which optimizes the Redis storage to:
3+
- Avoid lazy require of the `ioredis` dependency when the SDK is initialized, and
4+
- Flag the SDK as ready from cache immediately to allow queueing feature flag evaluations before SDK_READY event is emitted.
5+
16
11.2.0 (March 28, 2025)
27
- Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
38
- Added two new configuration options for the SDK's `LOCALSTORAGE` storage type to control the behavior of the persisted rollout plan cache in the browser:
@@ -122,7 +127,8 @@
122127
10.22.0 (October 5, 2022)
123128
- Added a new impressions mode for the SDK called NONE, to be used in factory when there is no desire to capture impressions on an SDK factory to feed Split's analytics engine. Running NONE mode, the SDK will only capture unique keys evaluated for a particular feature flag instead of full blown impressions.
124129
- Updated default value of `scheduler.featuresRefreshRate` config parameter from 5 seconds to 60 seconds for Node.js and from 30 seconds to 60 seconds for Browser.
125-
- Updated @splitsoftware/splitio-commons package to version 1.7.1, that improves the performance of feature flag evaluations (i.e., `getTreatment(s)` method calls) when using the default storage in memory, among other improvements.
130+
- Updated @splitsoftware/splitio-commons package to version 1.7.1, that improves the performance of feature flag evaluations (i.e., `getTreatment(s)` method calls) when using the default storage in memory,
131+
and avoid calling the storage for cached feature flags when the SDK is not ready or ready from cache, among other improvements.
126132

127133
10.21.1 (July 25, 2022)
128134
- Bugfixing - Added missed type definitions `enabled` from `sync`.

package-lock.json

Lines changed: 10 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.2.0",
3+
"version": "11.2.1-rc.2",
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.2.0",
41+
"@splitsoftware/splitio-commons": "2.2.1-rc.3",
4242
"bloom-filters": "^3.0.4",
4343
"ioredis": "^4.28.0",
4444
"js-yaml": "^3.13.1",

src/__tests__/consumer/node_redis.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ tape('Node.js Redis', function (t) {
104104
const client = sdk.client();
105105
const manager = sdk.manager();
106106

107-
/** Evaluation, track and manager methods before SDK_READY */
108-
client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT').then(result => assert.equal(result, 'control', 'Evaluations using Redis storage should be control until connection is stablished.'));
109-
client.getTreatment('other', 'UT_IN_SEGMENT').then(result => assert.equal(result, 'control', 'Evaluations using Redis storage should be control until connection is stablished.'));
107+
/** Evaluation, track and manager methods before SDK_READY (but SDK_READY_FROM_CACHE) */
108+
client.getTreatment('UT_Segment_member', 'UT_IN_SEGMENT').then(result => assert.equal(result, 'on', 'Evaluations using Redis storage should be control until connection is stablished.'));
109+
client.getTreatment('other', 'UT_IN_SEGMENT').then(result => assert.equal(result, 'off', 'Evaluations using Redis storage should be control until connection is stablished.'));
110110

111-
manager.names().then((result) => assert.deepEqual(result, [], 'manager `names` method returns an empty list of split names if called before SDK_READY or Redis operation fail'));
112-
manager.split(expectedSplitName).then((result) => assert.deepEqual(result, null, 'manager `split` method returns a null split view if called before SDK_READY or Redis operation fail'));
113-
manager.splits().then((result) => assert.deepEqual(result, [], 'manager `splits` method returns an empty list of split views if called before SDK_READY or Redis operation fail'));
111+
manager.names().then((result) => assert.equal(result.length, 26, 'manager `names` method returns an empty list of split names if called before SDK_READY or Redis operation fail'));
112+
manager.split(expectedSplitName).then((result) => assert.deepEqual(result, expectedSplitView, 'manager `split` method returns a null split view if called before SDK_READY or Redis operation fail'));
113+
manager.splits().then((result) => assert.equal(result.length, 26, 'manager `splits` method returns an empty list of split views if called before SDK_READY or Redis operation fail'));
114114

115115
client.track('nicolas@split.io', 'user', 'before.ready', 18).then((result) => assert.true(result, 'Redis adapter queue "rpush" operations until it is ready.'));
116116

@@ -453,7 +453,7 @@ tape('Node.js Redis', function (t) {
453453
assert.plan(18);
454454

455455
client.getTreatment('UT_Segment_member', 'always-on').then(treatment => {
456-
assert.equal(treatment, 'control', 'Evaluations using Redis storage should be control until Redis connection is stablished.');
456+
assert.equal(treatment, 'on', 'Evaluations using Redis storage should be control until Redis connection is stablished.');
457457
});
458458
client.track('nicolas@split.io', 'user', 'test.redis.event', 18).then(result => {
459459
assert.true(result, 'If the event was successfully queued the promise will resolve to true once Redis connection is stablished');
@@ -687,7 +687,7 @@ tape('Node.js Redis', function (t) {
687687

688688
const client = sdk.client();
689689

690-
client.getTreatmentsWithConfigByFlagSets('other', ['set_one']).then(result => assert.deepEqual(result, {}, 'Flag sets evaluations using Redis storage should be empty until connection is ready.'));
690+
client.getTreatmentsWithConfigByFlagSets('other', ['set_one']).then(result => assert.deepEqual(result, { 'always-on': { treatment: 'on', config: null }, 'always-off': { treatment: 'off', config: null } }, 'Flag sets evaluations using Redis storage should be empty until connection is ready.'));
691691

692692
await client.ready();
693693

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.2.0';
1+
export const packageVersion = '11.2.1-rc.2';

0 commit comments

Comments
 (0)