@@ -114,8 +114,10 @@ export var bucket = function(bucketerParams) {
114
114
var entityId = this . _findBucket ( bucketValue , bucketerParams . trafficAllocationConfig ) ;
115
115
116
116
if ( ! bucketerParams . variationIdMap . hasOwnProperty ( entityId ) ) {
117
- var invalidVariationIdLogMessage = sprintf ( LOG_MESSAGES . INVALID_VARIATION_ID , MODULE_NAME ) ;
118
- bucketerParams . logger . log ( LOG_LEVEL . WARNING , invalidVariationIdLogMessage ) ;
117
+ if ( entityId ) {
118
+ var invalidVariationIdLogMessage = sprintf ( LOG_MESSAGES . INVALID_VARIATION_ID , MODULE_NAME ) ;
119
+ bucketerParams . logger . log ( LOG_LEVEL . WARNING , invalidVariationIdLogMessage ) ;
120
+ }
119
121
return null ;
120
122
}
121
123
@@ -128,7 +130,7 @@ export var bucket = function(bucketerParams) {
128
130
* @param {string } bucketingId Bucketing ID
129
131
* @param {string } userId ID of user to be bucketed into experiment
130
132
* @param {Object } logger Logger implementation
131
- * @return {string } ID of experiment if user is bucketed into experiment within the group, null otherwise
133
+ * @return {string|null } ID of experiment if user is bucketed into experiment within the group, null otherwise
132
134
*/
133
135
export var bucketUserIntoExperiment = function ( group , bucketingId , userId , logger ) {
134
136
var bucketingKey = sprintf ( '%s%s' , bucketingId , group . id ) ;
@@ -148,7 +150,7 @@ export var bucketUserIntoExperiment = function(group, bucketingId, userId, logge
148
150
* @param {Object[] } trafficAllocationConfig
149
151
* @param {number } trafficAllocationConfig[].endOfRange
150
152
* @param {number } trafficAllocationConfig[].entityId
151
- * @return {string } Entity ID for bucketing if bucket value is within traffic allocation boundaries, null otherwise
153
+ * @return {string|null } Entity ID for bucketing if bucket value is within traffic allocation boundaries, null otherwise
152
154
*/
153
155
export var _findBucket = function ( bucketValue , trafficAllocationConfig ) {
154
156
for ( var i = 0 ; i < trafficAllocationConfig . length ; i ++ ) {
0 commit comments