Skip to content

chore: Prepare for 4.2.1 release #550

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

Merged
merged 2 commits into from
Aug 10, 2020
Merged
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
5 changes: 5 additions & 0 deletions packages/optimizely-sdk/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [4.2.1] - August 10, 2020

### Bug fixes
- Remove incorrect warning about invalid variation ID when user not bucketed into experiment or feature rollout ([#549](https://github.com/optimizely/javascript-sdk/pull/549))

## [4.2.0] - July 31, 2020

### New Features
Expand Down
10 changes: 6 additions & 4 deletions packages/optimizely-sdk/lib/core/bucketer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ export var bucket = function(bucketerParams) {
var entityId = this._findBucket(bucketValue, bucketerParams.trafficAllocationConfig);

if (!bucketerParams.variationIdMap.hasOwnProperty(entityId)) {
var invalidVariationIdLogMessage = sprintf(LOG_MESSAGES.INVALID_VARIATION_ID, MODULE_NAME);
bucketerParams.logger.log(LOG_LEVEL.WARNING, invalidVariationIdLogMessage);
if (entityId) {
var invalidVariationIdLogMessage = sprintf(LOG_MESSAGES.INVALID_VARIATION_ID, MODULE_NAME);
bucketerParams.logger.log(LOG_LEVEL.WARNING, invalidVariationIdLogMessage);
}
return null;
}

Expand All @@ -128,7 +130,7 @@ export var bucket = function(bucketerParams) {
* @param {string} bucketingId Bucketing ID
* @param {string} userId ID of user to be bucketed into experiment
* @param {Object} logger Logger implementation
* @return {string} ID of experiment if user is bucketed into experiment within the group, null otherwise
* @return {string|null} ID of experiment if user is bucketed into experiment within the group, null otherwise
*/
export var bucketUserIntoExperiment = function(group, bucketingId, userId, logger) {
var bucketingKey = sprintf('%s%s', bucketingId, group.id);
Expand All @@ -148,7 +150,7 @@ export var bucketUserIntoExperiment = function(group, bucketingId, userId, logge
* @param {Object[]} trafficAllocationConfig
* @param {number} trafficAllocationConfig[].endOfRange
* @param {number} trafficAllocationConfig[].entityId
* @return {string} Entity ID for bucketing if bucket value is within traffic allocation boundaries, null otherwise
* @return {string|null} Entity ID for bucketing if bucket value is within traffic allocation boundaries, null otherwise
*/
export var _findBucket = function(bucketValue, trafficAllocationConfig) {
for (var i = 0; i < trafficAllocationConfig.length; i++) {
Expand Down
9 changes: 9 additions & 0 deletions packages/optimizely-sdk/lib/core/bucketer/index.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ describe('lib/core/bucketer', function() {
bucketerParamsTest1.userId = 'ppid1';
expect(bucketer.bucket(bucketerParamsTest1)).to.equal(null);
});

it('should not log an invalid variation ID warning', function() {
bucketer.bucket(bucketerParams)
const foundInvalidVariationWarning = createdLogger.log.getCalls().some((call) => {
const message = call.args[1];
return message.includes('Bucketed into an invalid variation ID')
});
expect(foundInvalidVariationWarning).to.equal(false);
});
});

describe('when the traffic allocation has invalid variation ids', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.browser.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('javascript-sdk', function() {
optlyInstance.onReady().catch(function() {});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '4.2.0');
assert.equal(optlyInstance.clientVersion, '4.2.1');
});

it('should set the JavaScript client engine and version', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.node.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('optimizelyFactory', function() {
optlyInstance.onReady().catch(function() {});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '4.2.0');
assert.equal(optlyInstance.clientVersion, '4.2.1');
});

describe('event processor configuration', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.react_native.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('javascript-sdk/react-native', function() {
optlyInstance.onReady().catch(function() {});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '4.2.0');
assert.equal(optlyInstance.clientVersion, '4.2.1');
});

it('should set the Javascript client engine and version', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/utils/enums/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export var CONTROL_ATTRIBUTES = {
export var JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
export var NODE_CLIENT_ENGINE = 'node-sdk';
export var REACT_CLIENT_ENGINE = 'react-sdk';
export var NODE_CLIENT_VERSION = '4.2.0';
export var NODE_CLIENT_VERSION = '4.2.1';

export var VALID_CLIENT_ENGINES = [
NODE_CLIENT_ENGINE,
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/optimizely-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optimizely/optimizely-sdk",
"version": "4.2.0",
"version": "4.2.1",
"description": "JavaScript SDK for Optimizely X Full Stack",
"module": "dist/optimizely.browser.es.min.js",
"main": "dist/optimizely.node.min.js",
Expand Down