Skip to content

Commit

Permalink
remove WithTraceContext() for UserContext
Browse files Browse the repository at this point in the history
  • Loading branch information
pulak-opti committed Jan 18, 2024
1 parent 5389def commit 7b9cba0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
7 changes: 0 additions & 7 deletions pkg/client/optimizely_user_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package client

import (
"context"
"errors"
"sync"

Expand Down Expand Up @@ -81,12 +80,6 @@ func (o *OptimizelyUserContext) GetQualifiedSegments() []string {
return copyQualifiedSegments(o.qualifiedSegments)
}

// WithTraceContext sets the trace context for the OptimizelyClient instance's context
func (o *OptimizelyUserContext) WithTraceContext(ctx context.Context) *OptimizelyUserContext {
o.optimizely.WithTraceContext(ctx)
return o
}

func (o OptimizelyUserContext) getForcedDecisionService() *pkgDecision.ForcedDecisionService {
if o.forcedDecisionService != nil {
return o.forcedDecisionService.CreateCopy()
Expand Down
12 changes: 0 additions & 12 deletions pkg/client/optimizely_user_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package client

import (
"context"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -79,17 +78,6 @@ func (s *OptimizelyUserContextTestSuite) TestOptimizelyUserContextNoAttributesAn
s.Nil(optimizelyUserContext.GetQualifiedSegments())
}

func (s *OptimizelyUserContextTestSuite) TestOptimizelyUserContextWithTraceContext() {
attributes := map[string]interface{}{}
optimizelyUserContext := newOptimizelyUserContext(s.OptimizelyClient, s.userID, attributes, nil, nil)
ctx := context.WithValue(context.Background(), "testContext", true)
optimizelyUserContext.WithTraceContext(ctx)

clientCtx := s.OptimizelyClient.ctx
s.Equal(clientCtx, ctx)
s.Equal(clientCtx.Value("testContext"), true)
}

func (s *OptimizelyUserContextTestSuite) TestUpatingProvidedUserContextHasNoImpactOnOptimizelyUserContext() {
attributes := map[string]interface{}{"k1": "v1", "k2": false}
segments := []string{"123"}
Expand Down

0 comments on commit 7b9cba0

Please sign in to comment.