Skip to content

Commit

Permalink
No longer cache a PrivacyConfig instance in FeatureFlagger.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Apr 7, 2024
1 parent 1504f88 commit 5ac3cc6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10036,8 +10036,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 132.0.1;
branch = "sam/avoid-caching-privacy-config-in-feature-flagger";
kind = branch;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "73f68ee1c0dda3cd4a0b0cc3cc38a6cc7e605829",
"version" : "132.0.1"
"branch" : "sam/avoid-caching-privacy-config-in-feature-flagger",
"revision" : "a9e64d85bf3ebbf32da72488eadf3ea7075bd2d8"
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions DuckDuckGo/AppDependencyProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class AppDependencyProvider: DependencyProvider {
let variantManager: VariantManager = DefaultVariantManager()

let internalUserDecider: InternalUserDecider = ContentBlocking.shared.privacyConfigurationManager.internalUserDecider
private lazy var privacyConfig: PrivacyConfiguration = ContentBlocking.shared.privacyConfigurationManager.privacyConfig
lazy var featureFlagger: FeatureFlagger = DefaultFeatureFlagger(internalUserDecider: internalUserDecider, privacyConfig: privacyConfig)
lazy var featureFlagger: FeatureFlagger = DefaultFeatureFlagger(
internalUserDecider: internalUserDecider,
privacyConfigManager: ContentBlocking.shared.privacyConfigurationManager
)

let remoteMessagingStore: RemoteMessagingStore = RemoteMessagingStore()
lazy var homePageConfiguration: HomePageConfiguration = HomePageConfiguration(variantManager: variantManager,
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGoTests/AppUserDefaultsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class AppUserDefaultsTests: XCTestCase {
mockManager.privacyConfig = mockConfiguration(subfeatureEnabled: enabled)

let internalUserDecider = DefaultInternalUserDecider(store: internalUserDeciderStore)
return DefaultFeatureFlagger(internalUserDecider: internalUserDecider, privacyConfig: mockManager.privacyConfig)
return DefaultFeatureFlagger(internalUserDecider: internalUserDecider, privacyConfigManager: mockManager)
}

private func mockConfiguration(subfeatureEnabled: Bool) -> PrivacyConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ final class NetworkProtectionAccessControllerTests: XCTestCase {
mockManager.privacyConfig = mockConfiguration(subfeatureEnabled: enabled)

let internalUserDecider = DefaultInternalUserDecider(store: internalUserDeciderStore)
return DefaultFeatureFlagger(internalUserDecider: internalUserDecider, privacyConfig: mockManager.privacyConfig)
return DefaultFeatureFlagger(internalUserDecider: internalUserDecider, privacyConfigManager: mockManager)
}

private func mockConfiguration(subfeatureEnabled: Bool) -> PrivacyConfiguration {
Expand Down

0 comments on commit 5ac3cc6

Please sign in to comment.