-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(decide): clone user-context before calling optimizely decide #256
Conversation
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.
Looks good. A change suggested.
@@ -46,6 +46,8 @@ public OptimizelyUserContext(Optimizely optimizely, string userId, UserAttribute | |||
UserId = userId; | |||
} | |||
|
|||
private OptimizelyUserContext Clone() => new OptimizelyUserContext(Optimizely, UserId, Attributes, ErrorHandler, Logger); |
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.
change "Attributes" to "getAttributes()", which should be mutex protected while copying.
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.
Also rename it to Copy.
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.
lgtm. please address jae's comments.
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.
LGTM
Clone the current user-context and pass it to optimizely.decide(), decide all and in decideForKeys