diff --git a/go.mod b/go.mod index 3011ec4..f3c760b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/splitio/go-client/v6 go 1.18 require ( - github.com/splitio/go-split-commons/v6 v6.0.3-0.20241211200100-36a7e1a3eeb9 + github.com/splitio/go-split-commons/v6 v6.0.3-0.20241212182204-626e0eae79d0 github.com/splitio/go-toolkit/v5 v5.4.0 ) diff --git a/go.sum b/go.sum index d3ef39d..8fde1f0 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,8 @@ github.com/splitio/go-split-commons/v6 v6.0.2 h1:uvrNjyGCOHUjxVTB1pDUA+UB20Wypox github.com/splitio/go-split-commons/v6 v6.0.2/go.mod h1:D/XIY/9Hmfk9ivWsRsJVp439kEdmHbzUi3PKzQQDOXY= github.com/splitio/go-split-commons/v6 v6.0.3-0.20241211200100-36a7e1a3eeb9 h1:H5ALS64HcbNiEQyT8fLKPck9qEMpSjwM9DYeG0bvvTg= github.com/splitio/go-split-commons/v6 v6.0.3-0.20241211200100-36a7e1a3eeb9/go.mod h1:D/XIY/9Hmfk9ivWsRsJVp439kEdmHbzUi3PKzQQDOXY= +github.com/splitio/go-split-commons/v6 v6.0.3-0.20241212182204-626e0eae79d0 h1:8udmFWKfa/vPyMSLqupxwHkXv1DxJum77XXY0AeNQZE= +github.com/splitio/go-split-commons/v6 v6.0.3-0.20241212182204-626e0eae79d0/go.mod h1:D/XIY/9Hmfk9ivWsRsJVp439kEdmHbzUi3PKzQQDOXY= github.com/splitio/go-toolkit/v5 v5.4.0 h1:g5WFpRhQomnXCmvfsNOWV4s5AuUrWIZ+amM68G8NBKM= github.com/splitio/go-toolkit/v5 v5.4.0/go.mod h1:xYhUvV1gga9/1029Wbp5pjnR6Cy8nvBpjw99wAbsMko= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= diff --git a/splitio/client/client_test.go b/splitio/client/client_test.go index cb17ea7..29d30c8 100644 --- a/splitio/client/client_test.go +++ b/splitio/client/client_test.go @@ -140,7 +140,7 @@ func getFactory() SplitFactory { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsCounter := strategy.NewImpressionsCounter() impressionsStrategy := strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryStorage, false) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) return SplitFactory{ cfg: cfg, @@ -166,7 +166,7 @@ func getFactoryByFlagSets() SplitFactory { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsCounter := strategy.NewImpressionsCounter() impressionsStrategy := strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryStorage, false) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) return SplitFactory{ cfg: cfg, @@ -473,7 +473,7 @@ func TestClientPanicking(t *testing.T) { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsCounter := strategy.NewImpressionsCounter() impressionsStrategy := strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryMockedStorage, false) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) factory := SplitFactory{ cfg: cfg, @@ -650,7 +650,7 @@ func getClientForListener() SplitClient { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsCounter := strategy.NewImpressionsCounter() impressionsStrategy := strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryMockedStorage, true) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) factory := &SplitFactory{ cfg: cfg, @@ -1372,7 +1372,7 @@ func TestClient(t *testing.T) { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsStrategy := strategy.NewDebugImpl(impressionObserver, true) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) factory := &SplitFactory{cfg: cfg, impressionManager: impressionManager} client := SplitClient{ diff --git a/splitio/client/factory.go b/splitio/client/factory.go index 7fab2f9..c43403b 100644 --- a/splitio/client/factory.go +++ b/splitio/client/factory.go @@ -534,7 +534,7 @@ func setupLocalhostFactory( return nil, err } impressionsStrategy := strategy.NewDebugImpl(impressionObserver, cfg.Advanced.ImpressionListener != nil) - splitFactory.impressionManager = provisional.NewImpressionManager(impressionsStrategy) + splitFactory.impressionManager = provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) setFactory(splitFactory.apikey, splitFactory.logger) // Call fetching tasks as goroutine diff --git a/splitio/client/input_validator_test.go b/splitio/client/input_validator_test.go index cc56e23..12569b9 100644 --- a/splitio/client/input_validator_test.go +++ b/splitio/client/input_validator_test.go @@ -92,7 +92,7 @@ func getClient() SplitClient { impressionObserver, _ := strategy.NewImpressionObserver(500) impressionsCounter := strategy.NewImpressionsCounter() impressionsStrategy := strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryMockedStorage, true) - impressionManager := provisional.NewImpressionManager(impressionsStrategy) + impressionManager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) factory := &SplitFactory{cfg: cfg, impressionManager: impressionManager, storages: sdkStorages{ diff --git a/splitio/impressions/builder.go b/splitio/impressions/builder.go index 110a5ff..8ca7bf8 100644 --- a/splitio/impressions/builder.go +++ b/splitio/impressions/builder.go @@ -53,7 +53,8 @@ func BuildInMemoryManager( noneStrategy := strategy.NewNoneImpl(impressionsCounter, uniqueKeysTracker, listenerEnabled) if cfg.ImpressionsMode == config.ImpressionsModeNone { - return provisional.NewImpressionManager(noneStrategy), nil + impManager := provisional.NewImpressionManager(noneStrategy) + return impManager.(*provisional.ImpressionManagerImpl), nil } workers.ImpressionRecorder = impression.NewRecorderSingle(impressionStorage, splitAPI.ImpressionRecorder, logger, metadata, cfg.ImpressionsMode, telemetryStorage) @@ -72,7 +73,7 @@ func BuildInMemoryManager( impressionsStrategy = strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryStorage, listenerEnabled) } - manager := provisional.NewImpressionManager(impressionsStrategy) + manager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) manager.SetNoneStrategy(noneStrategy) return manager, nil @@ -102,7 +103,8 @@ func BuildRedisManager( noneStrategy := strategy.NewNoneImpl(impressionsCounter, uniqueKeysTracker, listenerEnabled) if cfg.ImpressionsMode == config.ImpressionsModeNone { - return provisional.NewImpressionManager(noneStrategy), nil + impManager := provisional.NewImpressionManager(noneStrategy) + return impManager.(*provisional.ImpressionManagerImpl), nil } impressionObserver, err := strategy.NewImpressionObserver(500) @@ -118,7 +120,7 @@ func BuildRedisManager( impressionsStrategy = strategy.NewOptimizedImpl(impressionObserver, impressionsCounter, telemetryRuntimeStorage, listenerEnabled) } - manager := provisional.NewImpressionManager(impressionsStrategy) + manager := provisional.NewImpressionManager(impressionsStrategy).(*provisional.ImpressionManagerImpl) manager.SetNoneStrategy(noneStrategy) return manager, nil