You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.txt
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
11.2.0 (March 28, 2025)
2
+
- Added 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 impression object sent to Split's backend. Read more in our docs.
3
+
1
4
11.1.0 (January 17, 2025)
2
5
- Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on `SplitView` type objects. Read more in our docs.
3
6
- Updated @splitsoftware/splitio-commons package to version 2.1.0.
client2.getTreatmentWithConfig('qc_team');// Validate that the impression is the same.
52
52
client3.getTreatment('qc_team',testAttrs);
@@ -58,7 +58,8 @@ export default function (assert) {
58
58
treatment: 'no',
59
59
bucketingKey: 'impr_bucketing_2',
60
60
label: 'default rule',
61
-
pt: undefined
61
+
pt: undefined,
62
+
properties: undefined
62
63
};
63
64
64
65
assert.equal(listener.logImpression.callCount,4,'Impression listener logImpression method should be called after we call client.getTreatment, once per each impression generated.');
@@ -71,7 +72,7 @@ export default function (assert) {
assert.true(dependencyChildImpr,'Split we wanted to evaluate should be present on the impressions.');
59
-
assert.false(resp.some(e=>e.f==='hierarchical_dep_always_on'),'Parent split evaluations should not result in impressions.');
60
-
assert.false(resp.some(e=>e.f==='hierarchical_dep_hierarchical'),'No matter how deep is the chain.');
61
-
assert.true(splitWithConfigImpr,'Split evaluated with config should have generated an impression too.');
62
-
assert.false(Object.prototype.hasOwnProperty.call(splitWithConfigImpr.i[0],'configuration'),'Impressions do not change with configuration evaluations.');
63
-
assert.false(Object.prototype.hasOwnProperty.call(splitWithConfigImpr.i[0],'config'),'Impressions do not change with configuration evaluations.');
Copy file name to clipboardExpand all lines: src/__tests__/consumer/node_redis.spec.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ const NA = 'NA';
23
23
24
24
constredisPort='6385';
25
25
26
-
constTOTAL_RAW_IMPRESSIONS=16;
26
+
constTOTAL_RAW_IMPRESSIONS=17;
27
27
constTOTAL_EVENTS=2;
28
28
constDEDUPED_IMPRESSIONS=3;
29
29
@@ -118,7 +118,8 @@ tape('Node.js Redis', function (t) {
118
118
119
119
/** Evaluation, track and manager methods on SDK_READY */
120
120
121
-
assert.equal(awaitclient.getTreatment('UT_Segment_member','UT_IN_SEGMENT'),'on','Evaluations using Redis storage should be correct.');
121
+
assert.equal(awaitclient.getTreatment('UT_Segment_member','UT_IN_SEGMENT',undefined,{properties: {/* empty properties are ignored */}}),'on','Evaluations using Redis storage should be correct.');
122
+
assert.equal(awaitclient.getTreatment('UT_Segment_member','UT_IN_SEGMENT',undefined,{properties: {some: 'value1'}}),'on','Evaluations using Redis storage should be correct.');
122
123
assert.equal(awaitclient.getTreatment('other','UT_IN_SEGMENT'),'off','Evaluations using Redis storage should be correct.');
123
124
124
125
assert.equal(awaitclient.getTreatment('UT_Segment_member','UT_NOT_IN_SEGMENT'),'off','Evaluations using Redis storage should be correct.');
@@ -223,7 +224,9 @@ tape('Node.js Redis', function (t) {
223
224
// this should be deduped
224
225
assert.equal(awaitclient.getTreatment('other','UT_IN_SEGMENT'),'off','Evaluations using Redis storage should be correct.');
225
226
// this should be deduped
226
-
assert.equal(awaitclient.getTreatment('other','UT_IN_SEGMENT'),'off','Evaluations using Redis storage should be correct.');
227
+
assert.equal(awaitclient.getTreatment('other','UT_IN_SEGMENT',undefined,{properties: {/* empty properties are ignored */}}),'off','Evaluations using Redis storage should be correct.');
228
+
// this should not be deduped because of properties
229
+
assert.equal(awaitclient.getTreatment('other','UT_IN_SEGMENT',undefined,{properties: {some: 'value1'}}),'off','Evaluations using Redis storage should be correct.');
227
230
228
231
assert.equal(awaitclient.getTreatment('UT_Segment_member','UT_NOT_IN_SEGMENT'),'off','Evaluations using Redis storage should be correct.');
229
232
assert.equal(awaitclient.getTreatment('other','UT_NOT_IN_SEGMENT'),'on','Evaluations using Redis storage should be correct.');
assert.true(listener.logImpression.callCount,4,'Impression listener logImpression method should be called after we call client.getTreatment, once per each impression generated.');
48
+
assert.equal(listener.logImpression.callCount,4,'Impression listener logImpression method should be called after we call client.getTreatment, once per each impression generated.');
assert.equal(output.t,expected.treatment,'Present impressions should have the correct treatment.');
76
76
assert.equal(output.r,expected.label,'Present impressions should have the correct label.');
77
77
assert.equal(output.c,expected.changeNumber,'Present impressions should have the correct changeNumber.');
78
+
assert.equal(output.properties,expected.properties,'Present impressions should have the correct properties.');
78
79
assert.true(output.m>=(performedWhenReady ? readyEvaluationsStart : evaluationsStart)&&output.m<=evaluationsEnd,'Present impressions should have the correct timestamp (test with error margin).');
0 commit comments