Skip to content

[FSSDK-10843] prepare for release 6.0.0 #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"jest.rootPath": "/workspaces/javascript-sdk/packages/optimizely-sdk",
"jest.rootPath": "/workspaces/javascript-sdk",
"jest.jestCommandLine": "./node_modules/.bin/jest",
"jest.autoRevealOutput": "on-exec-error",
"editor.tabSize": 2
}
"jest.outputConfig": "test-results-based",
"editor.tabSize": 2,
"jest.runMode": "deferred"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.0.0] - November 5, 2024

### Breaking Changes

- VUID is now opt-in instead of being automatically generated ([#950](https://github.com/optimizely/javascript-sdk/pull/950), [#951](https://github.com/optimizely/javascript-sdk/pull/951), [#954](https://github.com/optimizely/javascript-sdk/pull/954))
- require node >= 16

### New Features

- User Profile Service calls are batched in decideAll and decideForKeys methods ([#953](https://github.com/optimizely/javascript-sdk/pull/953))

### Bug Fixes

- When "activate" is called with a rollout experiment key (not ab-test), "invalid experiment key" is returned ([#953](https://github.com/optimizely/javascript-sdk/pull/953))


## [5.3.4] - Jun 28, 2024

### Changed
Expand Down
20 changes: 10 additions & 10 deletions lib/core/decision_service/index.tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2017-2022 Optimizely, Inc. and contributors *
* Copyright 2017-2022,2024 Optimizely, Inc. and contributors *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down Expand Up @@ -379,7 +379,7 @@ describe('lib/core/decision_service', function() {
);
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[4]),
'DECISION_SERVICE: Saved variation "control" of experiment "testExperiment" for user "decision_service_user".'
'DECISION_SERVICE: Saved user profile for user "decision_service_user".'
);
});

Expand All @@ -392,6 +392,7 @@ describe('lib/core/decision_service', function() {
optimizely: {},
userId: 'decision_service_user',
});

assert.strictEqual(
'control',
decisionServiceInstance.getVariation(configObj, experiment, user).result
Expand All @@ -400,11 +401,11 @@ describe('lib/core/decision_service', function() {
sinon.assert.calledOnce(bucketerStub); // should still go through with bucketing
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[0]),
'DECISION_SERVICE: User decision_service_user is not in the forced variation map.'
'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error.'
);
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[1]),
'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error.'
'DECISION_SERVICE: User decision_service_user is not in the forced variation map.'
);
});

Expand Down Expand Up @@ -1277,7 +1278,7 @@ describe('lib/core/decision_service', function() {
reasons: [],
};
experiment = configObj.experimentIdMap['594098'];
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
getVariationStub.withArgs(configObj, experiment, user).returns(fakeDecisionResponseWithArgs);
});
Expand Down Expand Up @@ -1493,12 +1494,11 @@ describe('lib/core/decision_service', function() {
decisionSource: DECISION_SOURCES.FEATURE_TEST,
};
assert.deepEqual(decision, expectedDecision);
sinon.assert.calledWithExactly(
sinon.assert.calledWith(
getVariationStub,
configObj,
experiment,
user,
{}
);
});
});
Expand All @@ -1511,7 +1511,7 @@ describe('lib/core/decision_service', function() {
optimizely: {},
userId: 'user1',
});
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
});

Expand Down Expand Up @@ -1550,7 +1550,7 @@ describe('lib/core/decision_service', function() {
result: 'var',
reasons: [],
};
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponseWithArgs);
getVariationStub.withArgs(configObj, 'exp_with_group', user).returns(fakeDecisionResponseWithArgs);
});
Expand Down Expand Up @@ -1607,7 +1607,7 @@ describe('lib/core/decision_service', function() {
optimizely: {},
userId: 'user1',
});
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
});

Expand Down
Loading
Loading