-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Added ODPManager implementation #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
dd028bf
a317407
443164c
faea784
191a6ec
f6276bc
4f629fa
bbf8ac1
4a54b4c
0995694
88b6684
29514ff
22b04ae
dcafcee
8747556
dfaa27b
c528dce
a5b28e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,7 +55,7 @@ public bool UpdateSettings(string apiKey, string apiHost, List<string> segmentsT | |||||
|
||||||
public List<string> FetchQualifiedSegments(string userId, List<OdpSegmentOption> options) | ||||||
{ | ||||||
if (!_enabled || SegmentManager == null) | ||||||
if (!_enabled || SegmentManager == null || !_odpConfig.IsReady()) | ||||||
{ | ||||||
_logger.Log(LogLevel.ERROR, Constants.ODP_NOT_ENABLED_MESSAGE); | ||||||
return null; | ||||||
|
@@ -66,7 +66,7 @@ public List<string> FetchQualifiedSegments(string userId, List<OdpSegmentOption> | |||||
|
||||||
public void IdentifyUser(string userId) | ||||||
{ | ||||||
if (!_enabled || EventManager == null) | ||||||
if (!_enabled || EventManager == null || !_odpConfig.IsReady()) | ||||||
{ | ||||||
_logger.Log(LogLevel.DEBUG, "ODP identify event not dispatched (ODP disabled)."); | ||||||
return; | ||||||
|
@@ -86,7 +86,7 @@ public void SendEvent(string type, string action, Dictionary<string, string> ide | |||||
Dictionary<string, object> data | ||||||
) | ||||||
{ | ||||||
if (!_enabled || EventManager == null) | ||||||
if (!_enabled || EventManager == null || !_odpConfig.IsReady()) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This validations should be in a single method and return true or false. please refactor it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My copy-paste finger started hurting, and I thought of that too. L89, would have me injecting the Manager that should be checked for Let me play with some options.... |
||||||
{ | ||||||
_logger.Log(LogLevel.DEBUG, "ODP event not dispatched (ODP disabled)."); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Implicit event sending (IdentifyUser) should be DEBUG level, but when clients try to send events when ODP is not ready, it should be ERROR. |
||||||
return; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a minor comment,
SegmentManager == null || !_enabled || !_odpConfig.IsReady()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can re-arrange (I think that's what you're asking)
I thought that perhaps
!_enabled
would evaluate to true more often than the others, but happy to switch.