diff --git a/.travis.yml b/.travis.yml index 4c49b99c4..a6e688c6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,18 +24,6 @@ jobs: notifications: email: false - - stage: 'Lint markdown files' - os: linux - language: generic - before_install: skip - install: - - npm i -g markdown-spellcheck - before_script: - - wget --quiet https://raw.githubusercontent.com/optimizely/mdspell-config/master/.spelling - script: - - mdspell -a -n -r --en-us '**/*.md' - after_success: skip - - stage: 'Trigger Integration Tests' language: minimal os: linux @@ -107,7 +95,7 @@ jobs: os: osx osx_image: xcode11.3 env: - - VERSION=3.4.0 + - VERSION=3.4.1 install: # install hub - wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub @@ -124,7 +112,7 @@ jobs: os: osx osx_image: xcode11.3 env: - - VERSION=3.4.0 + - VERSION=3.4.1 install: # install hub - wget https://github.com/github/hub/releases/download/v2.11.2/hub-darwin-amd64-2.11.2.tgz -O /tmp/hub-darwin-amd64-2.11.2.tgz && tar -xvf /tmp/hub-darwin-amd64-2.11.2.tgz -C /usr/local/opt && ln -s /usr/local/opt/hub-darwin-amd64-2.11.2/bin/hub /usr/local/bin/hub diff --git a/CHANGELOG.md b/CHANGELOG.md index 3387fd049..3b49464cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Optimizely Swift SDK Changelog +## 3.4.1 +September 22, 2020 + +### Bug Fixes +* Fix a bucketing error at traffic allocation boundaries. ([#365](https://github.com/optimizely/swift-sdk/pull/365)) +* Update DataStore directory on macOS. ([#355](https://github.com/optimizely/swift-sdk/pull/355)) + ## 3.4.0 July 9, 2020 diff --git a/OptimizelySwiftSDK.xcodeproj/project.pbxproj b/OptimizelySwiftSDK.xcodeproj/project.pbxproj index b2b29d382..242eaea88 100644 --- a/OptimizelySwiftSDK.xcodeproj/project.pbxproj +++ b/OptimizelySwiftSDK.xcodeproj/project.pbxproj @@ -27,12 +27,12 @@ 6E12B1D922C55A250005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B1DA22C55A250005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B1DB22C55A250005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B1DC22C55A250005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B1DD22C55A250005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B1DC22C55A250005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B1DD22C55A250005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B1DE22C55A250005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B1DF22C55A250005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B1E022C55A250005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B1E122C55A250005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B1E122C55A250005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B1E222C55A260005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B1E322C55A260005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B1E422C55A260005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -51,12 +51,12 @@ 6E12B1F122C55A260005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B1F222C55A260005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B1F322C55A260005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B1F422C55A260005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B1F522C55A260005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B1F422C55A260005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B1F522C55A260005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B1F622C55A260005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B1F722C55A260005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B1F822C55A260005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B1F922C55A260005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B1F922C55A260005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B1FA22C55A270005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B1FB22C55A270005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B1FC22C55A270005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -75,12 +75,12 @@ 6E12B20922C55A270005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B20A22C55A270005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B20B22C55A270005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B20C22C55A270005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B20D22C55A270005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B20C22C55A270005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B20D22C55A270005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B20E22C55A270005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B20F22C55A270005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B21022C55A270005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B21122C55A270005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B21122C55A270005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B21222C55A270005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B21322C55A270005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B21422C55A270005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -99,12 +99,12 @@ 6E12B22122C55A270005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B22222C55A270005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B22322C55A270005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B22422C55A270005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B22522C55A270005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B22422C55A270005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B22522C55A270005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B22622C55A270005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B22722C55A270005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B22822C55A270005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B22922C55A270005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B22922C55A270005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B22A22C55A280005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B22B22C55A280005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B22C22C55A280005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -123,12 +123,12 @@ 6E12B23922C55A280005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B23A22C55A280005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B23B22C55A280005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B23C22C55A280005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B23D22C55A280005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B23C22C55A280005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B23D22C55A280005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B23E22C55A280005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B23F22C55A280005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B24022C55A280005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B24122C55A280005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B24122C55A280005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B24222C55A280005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B24322C55A280005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B24422C55A280005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -147,12 +147,12 @@ 6E12B25122C55A280005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B25222C55A280005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B25322C55A280005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B25422C55A280005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B25522C55A280005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B25422C55A280005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B25522C55A280005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B25622C55A280005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B25722C55A280005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B25822C55A280005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B25922C55A280005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B25922C55A280005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B25A22C55A290005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B25B22C55A290005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B25C22C55A290005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -171,12 +171,12 @@ 6E12B26922C55A290005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B26A22C55A290005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B26B22C55A290005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B26C22C55A290005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B26D22C55A290005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B26C22C55A290005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B26D22C55A290005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B26E22C55A290005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B26F22C55A290005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B27022C55A290005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B27122C55A290005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B27122C55A290005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B27222C55A290005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B27322C55A290005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B27422C55A290005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -195,12 +195,12 @@ 6E12B28122C55A290005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B28222C55A290005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B28322C55A290005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B28422C55A290005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B28522C55A290005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B28422C55A290005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B28522C55A290005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B28622C55A290005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B28722C55A290005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B28822C55A290005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B28922C55A290005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B28922C55A290005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B28A22C55A2A0005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B28B22C55A2A0005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B28C22C55A2A0005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -219,12 +219,12 @@ 6E12B29922C55A2A0005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B29A22C55A2A0005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B29B22C55A2A0005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B29C22C55A2A0005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B29D22C55A2A0005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B29C22C55A2A0005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B29D22C55A2A0005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B29E22C55A2A0005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B29F22C55A2A0005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B2A022C55A2A0005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B2A122C55A2A0005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B2A122C55A2A0005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B2A222C55A2A0005E9E6 /* optimizely_6372300739_v4.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196222C5211100B2B157 /* optimizely_6372300739_v4.json */; }; 6E12B2A322C55A2A0005E9E6 /* feature_rollout_toggle_on.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196722C5211100B2B157 /* feature_rollout_toggle_on.json */; }; 6E12B2A422C55A2A0005E9E6 /* feature_rollout_toggle_off.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196822C5211100B2B157 /* feature_rollout_toggle_off.json */; }; @@ -243,12 +243,12 @@ 6E12B2B122C55A2A0005E9E6 /* typed_audience_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197522C5211100B2B157 /* typed_audience_datafile.json */; }; 6E12B2B222C55A2A0005E9E6 /* feature_exp.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197622C5211100B2B157 /* feature_exp.json */; }; 6E12B2B322C55A2A0005E9E6 /* empty_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197722C5211100B2B157 /* empty_datafile.json */; }; - 6E12B2B422C55A2A0005E9E6 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E12B2B522C55A2B0005E9E6 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E12B2B422C55A2A0005E9E6 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E12B2B522C55A2B0005E9E6 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E12B2B622C55A2B0005E9E6 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E12B2B722C55A2B0005E9E6 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E12B2B822C55A2B0005E9E6 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E12B2B922C55A2B0005E9E6 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E12B2B922C55A2B0005E9E6 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E12B2BA22C55A330005E9E6 /* 10_entities.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196422C5211100B2B157 /* 10_entities.json */; }; 6E12B2BB22C55A330005E9E6 /* 50_entities.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196522C5211100B2B157 /* 50_entities.json */; }; 6E12B2BC22C55A330005E9E6 /* 100_entities.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75196622C5211100B2B157 /* 100_entities.json */; }; @@ -367,12 +367,12 @@ 6E14CDC22423FA0800010234 /* empty_datafile_new_project_id.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E34A623231ED04900BAE302 /* empty_datafile_new_project_id.json */; }; 6E14CDC32423FA0800010234 /* empty_datafile_new_revision.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E34A624231ED04900BAE302 /* empty_datafile_new_revision.json */; }; 6E14CDC42423FA0800010234 /* empty_datafile_new_account_id.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E34A63D231ED28600BAE302 /* empty_datafile_new_account_id.json */; }; - 6E14CDC52423FA0800010234 /* BucketerTestsDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */; }; - 6E14CDC62423FA0800010234 /* BucketerTestsDatafile2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */; }; + 6E14CDC52423FA0800010234 /* bucketer_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197822C5211100B2B157 /* bucketer_test.json */; }; + 6E14CDC62423FA0800010234 /* bucketer_test2.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197922C5211100B2B157 /* bucketer_test2.json */; }; 6E14CDC72423FA0800010234 /* ab_experiments.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197A22C5211100B2B157 /* ab_experiments.json */; }; 6E14CDC82423FA0800010234 /* bot_filtering_enabled.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */; }; 6E14CDC92423FA0800010234 /* simple_datafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197C22C5211100B2B157 /* simple_datafile.json */; }; - 6E14CDCA2423FA0800010234 /* UnsupportedVersionDatafile.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */; }; + 6E14CDCA2423FA0800010234 /* unsupported_version.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E75197D22C5211100B2B157 /* unsupported_version.json */; }; 6E34A6172319EBB800BAE302 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E34A6162319EBB700BAE302 /* Notifications.swift */; }; 6E34A6182319EBB800BAE302 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E34A6162319EBB700BAE302 /* Notifications.swift */; }; 6E34A6192319EBB800BAE302 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E34A6162319EBB700BAE302 /* Notifications.swift */; }; @@ -1241,6 +1241,17 @@ 6E9B11E322C548AF00C22D81 /* ThrowableConditionListTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7519C922C5211100B2B157 /* ThrowableConditionListTest.swift */; }; 6E9B11E422C548B100C22D81 /* OtherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7519C822C5211100B2B157 /* OtherTests.swift */; }; 6E9B11E522C548B100C22D81 /* ThrowableConditionListTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7519C922C5211100B2B157 /* ThrowableConditionListTest.swift */; }; + 6EA0FB1F251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB20251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB21251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB22251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB23251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB24251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB25251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB26251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB27251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB28251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; + 6EA0FB29251A5AEC00EC002D /* bucketer_test3.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */; }; 6EA2CC242345618E001E7531 /* OptimizelyConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA2CC232345618E001E7531 /* OptimizelyConfig.swift */; }; 6EA2CC252345618E001E7531 /* OptimizelyConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA2CC232345618E001E7531 /* OptimizelyConfig.swift */; }; 6EA2CC262345618E001E7531 /* OptimizelyConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EA2CC232345618E001E7531 /* OptimizelyConfig.swift */; }; @@ -1276,6 +1287,7 @@ 6ECB60D4234D5D9C00016D41 /* OptimizelyConfig+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ECB60C9234D5D9C00016D41 /* OptimizelyConfig+ObjC.swift */; }; 6ECB60D5234D5D9C00016D41 /* OptimizelyConfig+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ECB60C9234D5D9C00016D41 /* OptimizelyConfig+ObjC.swift */; }; 6ECB60D7234E601A00016D41 /* OptimizelyClientTests_OptimizelyConfig_Objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 6ECB60D6234E601A00016D41 /* OptimizelyClientTests_OptimizelyConfig_Objc.m */; }; + BD1C3E8524E4399C0084B4DA /* SemanticVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B97DD93249D327F003DE606 /* SemanticVersion.swift */; }; BD64853C2491474500F30986 /* Optimizely.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E75167A22C520D400B2B157 /* Optimizely.h */; settings = {ATTRIBUTES = (Public, ); }; }; BD64853E2491474500F30986 /* Audience.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E75169822C520D400B2B157 /* Audience.swift */; }; BD64853F2491474500F30986 /* OptimizelyClient+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E75167622C520D400B2B157 /* OptimizelyClient+Extension.swift */; }; @@ -1543,12 +1555,12 @@ 6E75197522C5211100B2B157 /* typed_audience_datafile.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = typed_audience_datafile.json; sourceTree = ""; }; 6E75197622C5211100B2B157 /* feature_exp.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = feature_exp.json; sourceTree = ""; }; 6E75197722C5211100B2B157 /* empty_datafile.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = empty_datafile.json; sourceTree = ""; }; - 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = BucketerTestsDatafile.json; sourceTree = ""; }; - 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = BucketerTestsDatafile2.json; sourceTree = ""; }; + 6E75197822C5211100B2B157 /* bucketer_test.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = bucketer_test.json; sourceTree = ""; }; + 6E75197922C5211100B2B157 /* bucketer_test2.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = bucketer_test2.json; sourceTree = ""; }; 6E75197A22C5211100B2B157 /* ab_experiments.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = ab_experiments.json; sourceTree = ""; }; 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = bot_filtering_enabled.json; sourceTree = ""; }; 6E75197C22C5211100B2B157 /* simple_datafile.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = simple_datafile.json; sourceTree = ""; }; - 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = UnsupportedVersionDatafile.json; sourceTree = ""; }; + 6E75197D22C5211100B2B157 /* unsupported_version.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = unsupported_version.json; sourceTree = ""; }; 6E75197F22C5211100B2B157 /* MurmurTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MurmurTests.swift; sourceTree = ""; }; 6E75198022C5211100B2B157 /* DecisionServiceTests_Experiments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecisionServiceTests_Experiments.swift; sourceTree = ""; }; 6E75198122C5211100B2B157 /* OptimizelyErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptimizelyErrorTests.swift; sourceTree = ""; }; @@ -1617,6 +1629,7 @@ 6E7519C822C5211100B2B157 /* OtherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherTests.swift; sourceTree = ""; }; 6E7519C922C5211100B2B157 /* ThrowableConditionListTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThrowableConditionListTest.swift; sourceTree = ""; }; 6E981FC1232C363300FADDD6 /* DecisionListenerTests_Datafile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecisionListenerTests_Datafile.swift; sourceTree = ""; }; + 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = bucketer_test3.json; sourceTree = ""; }; 6EA2CC232345618E001E7531 /* OptimizelyConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptimizelyConfig.swift; sourceTree = ""; }; 6EA425082218E41500B074B5 /* OptimizelyTests-Common-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OptimizelyTests-Common-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 6EA4255B2218E58400B074B5 /* OptimizelyTests-DataModel-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OptimizelyTests-DataModel-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2015,12 +2028,13 @@ 6E34A623231ED04900BAE302 /* empty_datafile_new_project_id.json */, 6E34A624231ED04900BAE302 /* empty_datafile_new_revision.json */, 6E34A63D231ED28600BAE302 /* empty_datafile_new_account_id.json */, - 6E75197822C5211100B2B157 /* BucketerTestsDatafile.json */, - 6E75197922C5211100B2B157 /* BucketerTestsDatafile2.json */, + 6E75197822C5211100B2B157 /* bucketer_test.json */, + 6E75197922C5211100B2B157 /* bucketer_test2.json */, + 6EA0FB1E251A5AEC00EC002D /* bucketer_test3.json */, 6E75197A22C5211100B2B157 /* ab_experiments.json */, 6E75197B22C5211100B2B157 /* bot_filtering_enabled.json */, 6E75197C22C5211100B2B157 /* simple_datafile.json */, - 6E75197D22C5211100B2B157 /* UnsupportedVersionDatafile.json */, + 6E75197D22C5211100B2B157 /* unsupported_version.json */, ); path = TestData; sourceTree = ""; @@ -2551,14 +2565,15 @@ 6E14CDBC2423FA0800010234 /* grouped_experiments.json in Resources */, 6E14CDBE2423FA0800010234 /* audience_targeting.json in Resources */, 6E14CDC82423FA0800010234 /* bot_filtering_enabled.json in Resources */, - 6E14CDCA2423FA0800010234 /* UnsupportedVersionDatafile.json in Resources */, + 6EA0FB21251A5AEC00EC002D /* bucketer_test3.json in Resources */, + 6E14CDCA2423FA0800010234 /* unsupported_version.json in Resources */, 6E14CDC42423FA0800010234 /* empty_datafile_new_account_id.json in Resources */, 6E14CDC12423FA0800010234 /* empty_datafile.json in Resources */, 6E14CDB62423FA0800010234 /* rollout_bucketing.json in Resources */, 6E14CDB72423FA0800010234 /* feature_management_experiment_bucketing.json in Resources */, 6E14CDBA2423FA0800010234 /* api_datafile.json in Resources */, - 6E14CDC52423FA0800010234 /* BucketerTestsDatafile.json in Resources */, - 6E14CDC62423FA0800010234 /* BucketerTestsDatafile2.json in Resources */, + 6E14CDC52423FA0800010234 /* bucketer_test.json in Resources */, + 6E14CDC62423FA0800010234 /* bucketer_test2.json in Resources */, 6E14CDBF2423FA0800010234 /* typed_audience_datafile.json in Resources */, 6E14CDAE2423F9FC00010234 /* 50_entities.json in Resources */, 6E14CDB02423FA0800010234 /* optimizely_6372300739_v4.json in Resources */, @@ -2577,7 +2592,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B27122C55A290005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B27122C55A290005E9E6 /* unsupported_version.json in Resources */, 6E34A639231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B26922C55A290005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B26722C55A290005E9E6 /* feature_rollouts.json in Resources */, @@ -2595,12 +2610,13 @@ 6E12B26322C55A290005E9E6 /* feature_variables.json in Resources */, 6E12B26822C55A290005E9E6 /* audience_targeting.json in Resources */, 6E12B25B22C55A290005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB26251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B25C22C55A290005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B25D22C55A290005E9E6 /* feature_experiments.json in Resources */, 6E12B26F22C55A290005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B26C22C55A290005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B26C22C55A290005E9E6 /* bucketer_test.json in Resources */, 6E12B26B22C55A290005E9E6 /* empty_datafile.json in Resources */, - 6E12B26D22C55A290005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B26D22C55A290005E9E6 /* bucketer_test2.json in Resources */, 6E12B26A22C55A290005E9E6 /* feature_exp.json in Resources */, 6E12B25F22C55A290005E9E6 /* unsupported_datafile.json in Resources */, 6E12B26522C55A290005E9E6 /* feature_flag.json in Resources */, @@ -2614,7 +2630,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B21122C55A270005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B21122C55A270005E9E6 /* unsupported_version.json in Resources */, 6E34A635231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B20922C55A270005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B20722C55A270005E9E6 /* feature_rollouts.json in Resources */, @@ -2628,6 +2644,7 @@ 6E6BE00B237F547200FE8274 /* optimizely_config_datafile.json in Resources */, 6E12B1FA22C55A270005E9E6 /* optimizely_6372300739_v4.json in Resources */, 6E6BE00C237F547200FE8274 /* optimizely_config_expected.json in Resources */, + 6EA0FB22251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B20E22C55A270005E9E6 /* ab_experiments.json in Resources */, 6E12B20622C55A270005E9E6 /* grouped_experiments.json in Resources */, 6E34A629231ED04900BAE302 /* empty_datafile_new_project_id.json in Resources */, @@ -2637,9 +2654,9 @@ 6E12B1FC22C55A270005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B1FD22C55A270005E9E6 /* feature_experiments.json in Resources */, 6E12B20F22C55A270005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B20C22C55A270005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B20C22C55A270005E9E6 /* bucketer_test.json in Resources */, 6E12B20B22C55A270005E9E6 /* empty_datafile.json in Resources */, - 6E12B20D22C55A270005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B20D22C55A270005E9E6 /* bucketer_test2.json in Resources */, 6E12B20A22C55A270005E9E6 /* feature_exp.json in Resources */, 6E12B1FF22C55A270005E9E6 /* unsupported_datafile.json in Resources */, 6E12B20522C55A270005E9E6 /* feature_flag.json in Resources */, @@ -2653,7 +2670,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B25922C55A280005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B25922C55A280005E9E6 /* unsupported_version.json in Resources */, 6E34A638231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B25122C55A280005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B24F22C55A280005E9E6 /* feature_rollouts.json in Resources */, @@ -2671,12 +2688,13 @@ 6E12B24B22C55A280005E9E6 /* feature_variables.json in Resources */, 6E12B25022C55A280005E9E6 /* audience_targeting.json in Resources */, 6E12B24322C55A280005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB25251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B24422C55A280005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B24522C55A280005E9E6 /* feature_experiments.json in Resources */, 6E12B25722C55A280005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B25422C55A280005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B25422C55A280005E9E6 /* bucketer_test.json in Resources */, 6E12B25322C55A280005E9E6 /* empty_datafile.json in Resources */, - 6E12B25522C55A280005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B25522C55A280005E9E6 /* bucketer_test2.json in Resources */, 6E12B25222C55A280005E9E6 /* feature_exp.json in Resources */, 6E12B24722C55A280005E9E6 /* unsupported_datafile.json in Resources */, 6E12B24D22C55A280005E9E6 /* feature_flag.json in Resources */, @@ -2690,7 +2708,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B28922C55A290005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B28922C55A290005E9E6 /* unsupported_version.json in Resources */, 6E34A63A231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B28122C55A290005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B27F22C55A290005E9E6 /* feature_rollouts.json in Resources */, @@ -2708,12 +2726,13 @@ 6E12B27B22C55A290005E9E6 /* feature_variables.json in Resources */, 6E12B28022C55A290005E9E6 /* audience_targeting.json in Resources */, 6E12B27322C55A290005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB27251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B27422C55A290005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B27522C55A290005E9E6 /* feature_experiments.json in Resources */, 6E12B28722C55A290005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B28422C55A290005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B28422C55A290005E9E6 /* bucketer_test.json in Resources */, 6E12B28322C55A290005E9E6 /* empty_datafile.json in Resources */, - 6E12B28522C55A290005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B28522C55A290005E9E6 /* bucketer_test2.json in Resources */, 6E12B28222C55A290005E9E6 /* feature_exp.json in Resources */, 6E12B27722C55A290005E9E6 /* unsupported_datafile.json in Resources */, 6E12B27D22C55A290005E9E6 /* feature_flag.json in Resources */, @@ -2727,7 +2746,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B2A122C55A2A0005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B2A122C55A2A0005E9E6 /* unsupported_version.json in Resources */, 6E34A63B231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B29922C55A2A0005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B29722C55A2A0005E9E6 /* feature_rollouts.json in Resources */, @@ -2745,12 +2764,13 @@ 6E12B29322C55A2A0005E9E6 /* feature_variables.json in Resources */, 6E12B29822C55A2A0005E9E6 /* audience_targeting.json in Resources */, 6E12B28B22C55A2A0005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB28251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B28C22C55A2A0005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B28D22C55A2A0005E9E6 /* feature_experiments.json in Resources */, 6E12B29F22C55A2A0005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B29C22C55A2A0005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B29C22C55A2A0005E9E6 /* bucketer_test.json in Resources */, 6E12B29B22C55A2A0005E9E6 /* empty_datafile.json in Resources */, - 6E12B29D22C55A2A0005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B29D22C55A2A0005E9E6 /* bucketer_test2.json in Resources */, 6E12B29A22C55A2A0005E9E6 /* feature_exp.json in Resources */, 6E12B28F22C55A2A0005E9E6 /* unsupported_datafile.json in Resources */, 6E12B29522C55A2A0005E9E6 /* feature_flag.json in Resources */, @@ -2764,7 +2784,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B1F922C55A260005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B1F922C55A260005E9E6 /* unsupported_version.json in Resources */, 6E34A634231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B1F122C55A260005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B1EF22C55A260005E9E6 /* feature_rollouts.json in Resources */, @@ -2782,12 +2802,13 @@ 6E12B1EB22C55A260005E9E6 /* feature_variables.json in Resources */, 6E12B1F022C55A260005E9E6 /* audience_targeting.json in Resources */, 6E12B1E322C55A260005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB20251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B1E422C55A260005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B1E522C55A260005E9E6 /* feature_experiments.json in Resources */, 6E12B1F722C55A260005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B1F422C55A260005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B1F422C55A260005E9E6 /* bucketer_test.json in Resources */, 6E12B1F322C55A260005E9E6 /* empty_datafile.json in Resources */, - 6E12B1F522C55A260005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B1F522C55A260005E9E6 /* bucketer_test2.json in Resources */, 6E12B1F222C55A260005E9E6 /* feature_exp.json in Resources */, 6E12B1E722C55A260005E9E6 /* unsupported_datafile.json in Resources */, 6E12B1ED22C55A260005E9E6 /* feature_flag.json in Resources */, @@ -2801,7 +2822,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B22922C55A270005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B22922C55A270005E9E6 /* unsupported_version.json in Resources */, 6E34A636231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B22122C55A270005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B21F22C55A270005E9E6 /* feature_rollouts.json in Resources */, @@ -2819,12 +2840,13 @@ 6E12B21B22C55A270005E9E6 /* feature_variables.json in Resources */, 6E12B22022C55A270005E9E6 /* audience_targeting.json in Resources */, 6E12B21322C55A270005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB23251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B21422C55A270005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B21522C55A270005E9E6 /* feature_experiments.json in Resources */, 6E12B22722C55A270005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B22422C55A270005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B22422C55A270005E9E6 /* bucketer_test.json in Resources */, 6E12B22322C55A270005E9E6 /* empty_datafile.json in Resources */, - 6E12B22522C55A270005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B22522C55A270005E9E6 /* bucketer_test2.json in Resources */, 6E12B22222C55A270005E9E6 /* feature_exp.json in Resources */, 6E12B21722C55A270005E9E6 /* unsupported_datafile.json in Resources */, 6E12B21D22C55A270005E9E6 /* feature_flag.json in Resources */, @@ -2838,7 +2860,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B24122C55A280005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B24122C55A280005E9E6 /* unsupported_version.json in Resources */, 6E34A637231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B23922C55A280005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B23722C55A280005E9E6 /* feature_rollouts.json in Resources */, @@ -2856,12 +2878,13 @@ 6E12B23322C55A280005E9E6 /* feature_variables.json in Resources */, 6E12B23822C55A280005E9E6 /* audience_targeting.json in Resources */, 6E12B22B22C55A280005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB24251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B22C22C55A280005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B22D22C55A280005E9E6 /* feature_experiments.json in Resources */, 6E12B23F22C55A280005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B23C22C55A280005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B23C22C55A280005E9E6 /* bucketer_test.json in Resources */, 6E12B23B22C55A280005E9E6 /* empty_datafile.json in Resources */, - 6E12B23D22C55A280005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B23D22C55A280005E9E6 /* bucketer_test2.json in Resources */, 6E12B23A22C55A280005E9E6 /* feature_exp.json in Resources */, 6E12B22F22C55A280005E9E6 /* unsupported_datafile.json in Resources */, 6E12B23522C55A280005E9E6 /* feature_flag.json in Resources */, @@ -2875,7 +2898,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B2B922C55A2B0005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B2B922C55A2B0005E9E6 /* unsupported_version.json in Resources */, 6E34A63C231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B2B122C55A2A0005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B2AF22C55A2A0005E9E6 /* feature_rollouts.json in Resources */, @@ -2893,12 +2916,13 @@ 6E12B2AB22C55A2A0005E9E6 /* feature_variables.json in Resources */, 6E12B2B022C55A2A0005E9E6 /* audience_targeting.json in Resources */, 6E12B2A322C55A2A0005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB29251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B2A422C55A2A0005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B2A522C55A2A0005E9E6 /* feature_experiments.json in Resources */, 6E12B2B722C55A2B0005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B2B422C55A2A0005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B2B422C55A2A0005E9E6 /* bucketer_test.json in Resources */, 6E12B2B322C55A2A0005E9E6 /* empty_datafile.json in Resources */, - 6E12B2B522C55A2B0005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B2B522C55A2B0005E9E6 /* bucketer_test2.json in Resources */, 6E12B2B222C55A2A0005E9E6 /* feature_exp.json in Resources */, 6E12B2A722C55A2A0005E9E6 /* unsupported_datafile.json in Resources */, 6E12B2AD22C55A2A0005E9E6 /* feature_flag.json in Resources */, @@ -2919,7 +2943,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E12B1E122C55A250005E9E6 /* UnsupportedVersionDatafile.json in Resources */, + 6E12B1E122C55A250005E9E6 /* unsupported_version.json in Resources */, 6E34A633231ED04900BAE302 /* empty_datafile_new_revision.json in Resources */, 6E12B1D922C55A250005E9E6 /* typed_audience_datafile.json in Resources */, 6E12B1D722C55A250005E9E6 /* feature_rollouts.json in Resources */, @@ -2937,12 +2961,13 @@ 6E12B1D322C55A250005E9E6 /* feature_variables.json in Resources */, 6E12B1D822C55A250005E9E6 /* audience_targeting.json in Resources */, 6E12B1CB22C55A250005E9E6 /* feature_rollout_toggle_on.json in Resources */, + 6EA0FB1F251A5AEC00EC002D /* bucketer_test3.json in Resources */, 6E12B1CC22C55A250005E9E6 /* feature_rollout_toggle_off.json in Resources */, 6E12B1CD22C55A250005E9E6 /* feature_experiments.json in Resources */, 6E12B1DF22C55A250005E9E6 /* bot_filtering_enabled.json in Resources */, - 6E12B1DC22C55A250005E9E6 /* BucketerTestsDatafile.json in Resources */, + 6E12B1DC22C55A250005E9E6 /* bucketer_test.json in Resources */, 6E12B1DB22C55A250005E9E6 /* empty_datafile.json in Resources */, - 6E12B1DD22C55A250005E9E6 /* BucketerTestsDatafile2.json in Resources */, + 6E12B1DD22C55A250005E9E6 /* bucketer_test2.json in Resources */, 6E12B1DA22C55A250005E9E6 /* feature_exp.json in Resources */, 6E12B1CF22C55A250005E9E6 /* unsupported_datafile.json in Resources */, 6E12B1D522C55A250005E9E6 /* feature_flag.json in Resources */, @@ -4069,6 +4094,7 @@ BD6485772491474500F30986 /* TrafficAllocation.swift in Sources */, BD6485782491474500F30986 /* DataStoreMemory.swift in Sources */, BD6485792491474500F30986 /* LogMessage.swift in Sources */, + BD1C3E8524E4399C0084B4DA /* SemanticVersion.swift in Sources */, BD64857A2491474500F30986 /* AtomicProperty.swift in Sources */, BD64857B2491474500F30986 /* Notifications.swift in Sources */, ); diff --git a/README.md b/README.md index 20293f50a..073ce548d 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ Please note below that _\_ is used to represent the platform on which ``` dependencies: [ .package(url: "https://github.com/optimizely/swift-sdk.git", - .upToNextMinor(from: “3.4.0”)) + .upToNextMinor(from: “3.4.1”)) ] ``` #### CocoaPods 1. Add the following lines to the _Podfile_:
 ```use_frameworks!```
-```pod 'OptimizelySwiftSDK', '~> 3.4.0'```
+```pod 'OptimizelySwiftSDK', '~> 3.4.1'```
 
2. Run the following command:
``` pod install ```
@@ -49,7 +49,7 @@ dependencies: [ Further installation instructions for Cocoapods: https://guides.cocoapods.org/using/getting-started.html #### Carthage -1. Add the following lines to the _Cartfile_:
```github "optimizely/swift-sdk" ~> 3.4.0```
+1. Add the following lines to the _Cartfile_:
```github "optimizely/swift-sdk" ~> 3.4.1```
2. Run the following command:
```carthage update```
diff --git a/Sources/Implementation/Datastore/DataStoreFile.swift b/Sources/Implementation/Datastore/DataStoreFile.swift index a412be747..61b241c17 100644 --- a/Sources/Implementation/Datastore/DataStoreFile.swift +++ b/Sources/Implementation/Datastore/DataStoreFile.swift @@ -29,7 +29,7 @@ public class DataStoreFile: OPTDataStore where T: Codable { self.async = async dataStoreName = storeName lock = DispatchQueue(label: storeName) - #if os(tvOS) + #if os(tvOS) || os(macOS) let directory = FileManager.SearchPathDirectory.cachesDirectory #else let directory = FileManager.SearchPathDirectory.documentDirectory diff --git a/Sources/Implementation/DefaultBucketer.swift b/Sources/Implementation/DefaultBucketer.swift index 172957c63..926ad0033 100644 --- a/Sources/Implementation/DefaultBucketer.swift +++ b/Sources/Implementation/DefaultBucketer.swift @@ -79,10 +79,7 @@ class DefaultBucketer: OPTBucketer { return nil } - for trafficAllocation in group.trafficAllocation where bucketValue <= trafficAllocation.endOfRange { - let experimentId = trafficAllocation.entityId - - // propagate errors and logs for unknown experiment + if let experimentId = allocateTraffic(trafficAllocation: group.trafficAllocation, bucketValue: bucketValue) { if let experiment = config.getExperiment(id: experimentId) { return experiment } else { @@ -93,7 +90,7 @@ class DefaultBucketer: OPTBucketer { return nil } - + func bucketToVariation(experiment: Experiment, bucketingId: String) -> Variation? { let hashId = makeHashIdFromBucketingId(bucketingId: bucketingId, entityId: experiment.id) let bucketValue = generateBucketValue(bucketingId: hashId) @@ -103,17 +100,24 @@ class DefaultBucketer: OPTBucketer { logger.e(.experimentHasNoTrafficAllocation(experiment.key)) return nil } - - for trafficAllocation in experiment.trafficAllocation where bucketValue <= trafficAllocation.endOfRange { - let variationId = trafficAllocation.entityId - - // propagate errors and logs for unknown variation + + if let variationId = allocateTraffic(trafficAllocation: experiment.trafficAllocation, bucketValue: bucketValue) { if let variation = experiment.getVariation(id: variationId) { return variation } else { logger.e(.userBucketedIntoInvalidVariation(variationId)) return nil } + } else { + return nil + } + } + + func allocateTraffic(trafficAllocation: [TrafficAllocation], bucketValue: Int) -> String? { + for bucket in trafficAllocation { + if bucketValue < bucket.endOfRange { + return bucket.entityId + } } return nil diff --git a/Tests/OptimizelyTests-Common/BucketTests_Base.swift b/Tests/OptimizelyTests-Common/BucketTests_Base.swift index 6f147ba51..c3c92fc1d 100644 --- a/Tests/OptimizelyTests-Common/BucketTests_Base.swift +++ b/Tests/OptimizelyTests-Common/BucketTests_Base.swift @@ -41,4 +41,59 @@ class BucketTests_Base: XCTestCase { } } + func testAllocateExperimentTraffic() { + var experimentData: [String: Any] { return + [ + "status": "Running", + "id": "12345", + "key": "experimentA", + "layerId": "10420273888", + "trafficAllocation": [ + [ + "entityId": "1000", + "endOfRange": 0 + ], + [ + "entityId": "1001", + "endOfRange": 3000 + ], + [ + "entityId": "1002", + "endOfRange": 6000 + ] + ], + "audienceIds": [], + "variations": [ + [ + "variables": [], + "id": "1000", + "key": "a" + ], + [ + "variables": [], + "id": "1001", + "key": "b" + ], + [ + "variables": [], + "id": "1002", + "key": "c" + ] + ], + "forcedVariations": [:] + ] + } + + let bucketer = DefaultBucketer() + let experiment: Experiment = try! OTUtils.model(from: experimentData) + let trafficAllocation = experiment.trafficAllocation + + XCTAssert(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 0) == "1001") + XCTAssert(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 2999) == "1001") + XCTAssert(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 3000) == "1002") + XCTAssert(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 5999) == "1002") + XCTAssertNil(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 6000)) + XCTAssertNil(bucketer.allocateTraffic(trafficAllocation: trafficAllocation, bucketValue: 7000)) + } + } diff --git a/Tests/OptimizelyTests-Common/BucketTests_Others.swift b/Tests/OptimizelyTests-Common/BucketTests_Others.swift index e4cdf17b1..d07117b61 100644 --- a/Tests/OptimizelyTests-Common/BucketTests_Others.swift +++ b/Tests/OptimizelyTests-Common/BucketTests_Others.swift @@ -176,7 +176,7 @@ extension BucketTests_Others { extension BucketTests_Others { func testBucketExperimentInMutexGroup() { - let optimizely = OTUtils.createOptimizely(datafileName: "BucketerTestsDatafile", clearUserProfileService: true)! + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test", clearUserProfileService: true)! let group = optimizely.config!.getGroup(id: "1886780721")! let bucketer = DefaultBucketer() @@ -200,7 +200,7 @@ extension BucketTests_Others { } func testBucketReturnsNilWhenExperimentIsExcludedFromMutex() { - let optimizely = OTUtils.createOptimizely(datafileName: "BucketerTestsDatafile", clearUserProfileService: true)! + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test", clearUserProfileService: true)! let config = optimizely.config! let bucketer = DefaultBucketer() @@ -237,7 +237,7 @@ extension BucketTests_Others { } func testBucketExperimentWithMutexDoesNotChangeExperimentReference() { - let optimizely = OTUtils.createOptimizely(datafileName: "BucketerTestsDatafile", clearUserProfileService: true)! + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test", clearUserProfileService: true)! let config = optimizely.config! let bucketer = DefaultBucketer() @@ -248,7 +248,7 @@ extension BucketTests_Others { } func testBucketWithBucketingId() { - let optimizely = OTUtils.createOptimizely(datafileName: "BucketerTestsDatafile2", clearUserProfileService: true)! + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test2", clearUserProfileService: true)! let config = optimizely.config! let bucketer = DefaultBucketer() @@ -269,7 +269,7 @@ extension BucketTests_Others { func testBucketVariationGroupedExperimentsWithBucketingId() { // make sure that bucketing works with experiments in group - let optimizely = OTUtils.createOptimizely(datafileName: "BucketerTestsDatafile2", clearUserProfileService: true)! + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test2", clearUserProfileService: true)! let config = optimizely.config! let bucketer = DefaultBucketer() @@ -296,4 +296,16 @@ extension BucketTests_Others { XCTAssertNil(variation) } + func testBucketVariationAtBoundaries() { + // testing #OASIS-7150 + // userId(2113143589306368718) + experId(18513703488) = “211314358930636871818513703488” creates a hash value of 0 + + let optimizely = OTUtils.createOptimizely(datafileName: "bucketer_test3", clearUserProfileService: true)! + + XCTAssertFalse(optimizely.isFeatureEnabled(featureKey: "async_payments", userId: "2113143589306368718")) + XCTAssertFalse(optimizely.isFeatureEnabled(featureKey: "async_payments", userId: "2113143589306368719")) + XCTAssertFalse(optimizely.isFeatureEnabled(featureKey: "async_payments", userId: "2113143589306368710")) + XCTAssertFalse(optimizely.isFeatureEnabled(featureKey: "async_payments", userId: "2113143589306368711")) + XCTAssertFalse(optimizely.isFeatureEnabled(featureKey: "async_payments", userId: "2113143589306368712")) + } } diff --git a/Tests/TestData/BucketerTestsDatafile.json b/Tests/TestData/bucketer_test.json similarity index 100% rename from Tests/TestData/BucketerTestsDatafile.json rename to Tests/TestData/bucketer_test.json diff --git a/Tests/TestData/BucketerTestsDatafile2.json b/Tests/TestData/bucketer_test2.json similarity index 100% rename from Tests/TestData/BucketerTestsDatafile2.json rename to Tests/TestData/bucketer_test2.json diff --git a/Tests/TestData/bucketer_test3.json b/Tests/TestData/bucketer_test3.json new file mode 100644 index 000000000..651e19cf3 --- /dev/null +++ b/Tests/TestData/bucketer_test3.json @@ -0,0 +1,51 @@ +{ + "version": "4", + "rollouts": [ + { + "experiments": [ + { + "status": "Running", + "audienceIds": [ ], + "variations": [ + { + "variables": [ ], + "id": "18532971919", + "key": "18532971919", + "featureEnabled": true + } + ], + "id": "18513703488", + "key": "18513703488", + "layerId": "18513932701", + "trafficAllocation": [ + { + "entityId": "18532971919", + "endOfRange": 0 + } + ], + "forcedVariations": { } + } + ], + "id": "18513932701" + } + ], + "anonymizeIP": true, + "projectId": "10431130345", + "variables": [], + "featureFlags": [ + { + "experimentIds": [], + "rolloutId": "18513932701", + "variables": [], + "id": "18533552281", + "key": "async_payments" + } + ], + "experiments": [], + "audiences": [], + "groups": [], + "attributes": [], + "accountId": "10367498574", + "events": [], + "revision": "100" +} diff --git a/Tests/TestData/UnsupportedVersionDatafile.json b/Tests/TestData/unsupported_version.json similarity index 100% rename from Tests/TestData/UnsupportedVersionDatafile.json rename to Tests/TestData/unsupported_version.json