Skip to content

Commit 6cfbc61

Browse files
Replace weight calculation with a rounded ceil (#52)
1 parent 16df6eb commit 6cfbc61

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.62.2] - 2023-11-03
9+
10+
### Fixed
11+
12+
- Replace weight calculation with a rounded ceil (Merging PR by @samc : https://github.com/wingify/vwo-node-sdk/pull/52). This is a patch for a specific customer.
13+
814
## [1.62.1] - 2023-10-23
915

1016
### Fixed

dist/vwo-javascript-sdk.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vwo-javascript-sdk.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vwo-javascript-sdk.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vwo-javascript-sdk.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils/DecisionUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ let DecisionUtil = {
10131013
) {
10141014
// normalise the weights of all the shortlisted campaigns
10151015
shortlistedCampaigns.forEach(campaign => {
1016-
campaign.weight = Math.floor(100 / shortlistedCampaigns.length);
1016+
campaign.weight = Math.ceil((100 / shortlistedCampaigns.length) * 10) / 10;
10171017
});
10181018

10191019
// re-distribute the traffic for each camapign

0 commit comments

Comments
 (0)