Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0a7b1ee
add odp to project and user context
andrewleap-optimizely Sep 27, 2022
f47cff6
fix broken tests
andrewleap-optimizely Sep 27, 2022
ce1b1ae
add project/user_context odp tests
andrewleap-optimizely Sep 28, 2022
2bcd343
Merge branch 'master' into aleap/add_odp_to_client_and_user_context
andrewleap-optimizely Sep 28, 2022
22fee39
enable odp for legacy tests
andrewleap-optimizely Sep 29, 2022
503172a
syncronize qualified_for
andrewleap-optimizely Sep 29, 2022
9e4482b
skip segments_cache if odp disabled
andrewleap-optimizely Sep 29, 2022
e3d4621
remove odp_manager from user_context
andrewleap-optimizely Sep 29, 2022
2ff91ff
make fetch_qualified_segments non blocking
andrewleap-optimizely Oct 3, 2022
ee0934b
add sdk_settings
andrewleap-optimizely Oct 3, 2022
784eb8a
rename zaius files
andrewleap-optimizely Oct 5, 2022
19ed8da
rename zaius classes/attributes
andrewleap-optimizely Oct 6, 2022
e58f444
extract odp setup to method
andrewleap-optimizely Oct 6, 2022
de97dc3
add non blocking flag to fetch_qualified_segments
andrewleap-optimizely Oct 6, 2022
80619f9
change odp_state when config updated via setters
andrewleap-optimizely Oct 6, 2022
19dd02d
add support for sdk_settings in optimizely factory
andrewleap-optimizely Oct 6, 2022
94d75fd
remove api_key/api_host setters from odp_config
andrewleap-optimizely Oct 7, 2022
1062469
switch fetch_segments flag param to callback
andrewleap-optimizely Oct 7, 2022
d02b0e8
return status bool from sync fetch_segments
andrewleap-optimizely Oct 10, 2022
a0cd8a9
fix copyright
andrewleap-optimizely Oct 11, 2022
521ca7b
move method validation to init
andrewleap-optimizely Oct 11, 2022
e56d8b2
delay starting event_manager until odp integration
andrewleap-optimizely Oct 13, 2022
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
Prev Previous commit
Next Next commit
remove odp_manager from user_context
  • Loading branch information
andrewleap-optimizely committed Sep 29, 2022
commit e3d4621199f6226fca1508b2d93065d757d6aecc
8 changes: 8 additions & 0 deletions lib/optimizely.rb
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,14 @@ def send_odp_event(action:, type: Helpers::Constants::ODP_MANAGER_CONFIG[:EVENT_
@odp_manager.send_event(type: type, action: action, identifiers: identifiers, data: data)
end

def identify_user(user_id:)
@odp_manager.identify_user(user_id: user_id)
end

def fetch_qualified_segments(user_id:, options: [])
@odp_manager.fetch_qualified_segments(user_id: user_id, options: options)
end

private

def get_variation_with_config(experiment_key, user_id, attributes, config)
Expand Down
4 changes: 2 additions & 2 deletions lib/optimizely/optimizely_user_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def initialize(optimizely_client, user_id, user_attributes)
@forced_decisions = {}
@qualified_segments = nil

@optimizely_client.odp_manager.identify_user(user_id: user_id)
@optimizely_client&.identify_user(user_id: user_id)
end

def clone
Expand Down Expand Up @@ -216,7 +216,7 @@ def qualified_for?(segment)
# @return On success, returns a non-nil segments array (can be empty). On failure, nil is returned.

def fetch_qualified_segments(options = [])
segments = @optimizely_client.odp_manager.fetch_qualified_segments(user_id: @user_id, options: options)
segments = @optimizely_client&.fetch_qualified_segments(user_id: @user_id, options: options)
self.qualified_segments = segments
segments
end
Expand Down