Skip to content
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: Add thread-safe UserAttributes in read/write operations. #253

Merged
merged 60 commits into from
Dec 10, 2020

Conversation

mnoman09
Copy link
Contributor

@mnoman09 mnoman09 commented Dec 8, 2020

Summary

  • Copying UserAttributes to make it thread safe.
  • Made All fields in OptimizelyUserContext private and added getter methods

Test plan

Updated all Unit tests

mnoman09 and others added 30 commits November 5, 2020 20:48
BugFix of userAttributes
Unit tests fix
BugFix of userAttributes
Unit tests fix
Added Unit tests of above functions
Throwing not implemented exceptions for not implemented functions in optimizelyUserContext
Added detailed documentation of optimizelyUserContext and Decision class
# Conflicts:
#	OptimizelySDK.Tests/OptimizelyUserContextTest.cs
#	OptimizelySDK/OptimizelyUserContext.cs
# Conflicts:
#	OptimizelySDK/Optimizely.cs
# Conflicts:
#	OptimizelySDK/OptimizelyUserContext.cs
# Conflicts:
#	OptimizelySDK.Tests/OptimizelyUserContextTest.cs
# Conflicts:
#	OptimizelySDK.Tests/OptimizelyDecisions/OptimizelyDecisionTest.cs
#	OptimizelySDK.Tests/OptimizelyUserContextTest.cs
#	OptimizelySDK/Optimizely.cs
#	OptimizelySDK/OptimizelyDecisions/DefaultDecisionReasons.cs
#	OptimizelySDK/OptimizelyUserContext.cs
@mnoman09 mnoman09 requested a review from a team as a code owner December 8, 2020 14:33
@mnoman09 mnoman09 requested review from msohailhussain and removed request for a team December 8, 2020 14:40
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

Missing a mutex lock while making a copy. Other than that, all looks good!


public UserAttributes GetAttributes()
{
return new UserAttributes(Attributes);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need a mutex protection for this copy with the same lock for setAttribute?


public UserAttributes GetAttributes()
{
return new UserAttributes(Attributes);
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, mutex needed.

@msohailhussain msohailhussain requested a review from jaeopt December 8, 2020 19:27
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

Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

LGTM

…DecideOptions).ToArray();

with
                copiedOptions = options.Union(DefaultDecideOptions).ToArray();
# Conflicts:
#	OptimizelySDK.Tests/OptimizelyUserContextTest.cs
#	OptimizelySDK/Optimizely.cs
…utes

# Conflicts:
#	OptimizelySDK/Optimizely.cs
Base automatically changed from mnoman/decideAllApi to master December 9, 2020 20:03
msohailhussain and others added 3 commits December 9, 2020 12:13
…userattributes

# Conflicts:
#	OptimizelySDK.Tests/OptimizelyTest.cs
#	OptimizelySDK.Tests/OptimizelyUserContextTest.cs
#	OptimizelySDK/Optimizely.cs
#	OptimizelySDK/OptimizelyUserContext.cs
@jaeopt jaeopt merged commit 5754452 into master Dec 10, 2020
@jaeopt jaeopt deleted the mnoman/thread-safe-userattributes branch December 10, 2020 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants