Skip to content

Commit

Permalink
fix(variation_decider.rb): fix triggering hook twice in case pf pre-s…
Browse files Browse the repository at this point in the history
…egmmentation
  • Loading branch information
NAKULT authored and softvar committed Jul 27, 2022
1 parent 1d897ad commit ca46343
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.38.0] - 2022-27-07

### Changed

- Fix invoking `integrations` hook twice when variation is alloted to a non-whitelisted new user and pre-segmentation gets passed.

## [1.37.1] - 2022-25-04

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/vwo/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module CONSTANTS
HTTP_PROTOCOL = 'http://'
HTTPS_PROTOCOL = 'https://'
URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
SDK_VERSION = '1.37.1'
SDK_VERSION = '1.38.0'
SDK_NAME = 'ruby'
VWO_DELIMITER = '_vwo_'
MAX_EVENTS_PER_REQUEST = 5000
Expand Down
3 changes: 0 additions & 3 deletions lib/vwo/core/variation_decider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def get_variation(user_id, campaign, api_name, campaign_key, custom_variables =
variation ||= get_variation_if_presegmentation_applied(is_presegmentation, campaign, user_id, goal_identifier, decision)
return unless variation

decision = add_variation_to_decision_properties(decision, campaign, variation)
@hooks_manager.execute(decision)
variation
end

Expand Down Expand Up @@ -277,7 +275,6 @@ def initialize_decision_properties(user_id, campaign, api_name, custom_variables
variation_targeting_variables: variation_targeting_variables,
is_user_whitelisted: false,
from_user_storage_service: false,
is_feature_enabled: true,
# VWO generated UUID based on passed UserId and Account ID
vwo_user_id: generator_for(user_id, @settings_file['accountId'])
}
Expand Down

0 comments on commit ca46343

Please sign in to comment.