Skip to content

feat(decide): clone user-context before calling optimizely decide #417

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

Merged
merged 2 commits into from
Jan 11, 2021

Conversation

jaeopt
Copy link
Contributor

@jaeopt jaeopt commented Jan 8, 2021

Summary

Clone the current user-context and pass it to optimizely.decide()

  • user context can be changed while processing the decide request.
  • with this fix, decide can return the copy of the original user-context as a part of the decision

Test plan

  • Validate user-context are copied and passed as expected

@jaeopt jaeopt requested a review from a team as a code owner January 8, 2021 22:41
@jaeopt jaeopt removed their assignment Jan 8, 2021
@coveralls
Copy link

coveralls commented Jan 8, 2021

Pull Request Test Coverage Report for Build 1642

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 89.776%

Totals Coverage Status
Change from base Build 1633: 0.08%
Covered Lines: 4417
Relevant Lines: 4920

💛 - Coveralls

}

public Optimizely getOptimizely() {
return optimizely;
}

public OptimizelyUserContext copy() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about implementing CloneableInterface

Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jaeopt jaeopt merged commit 651ccdc into master Jan 11, 2021
@jaeopt jaeopt deleted the jae/clone-context branch January 11, 2021 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants