diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 32fcdc1f1d..f0825b974c 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -14972,7 +14972,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 206.0.0; + version = 207.0.0; }; }; 9D84E4002CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3ccf3ab119..cb75d168ef 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "d00f87a30e35fe8f86df30973c3b5370688e3aaa", - "version" : "206.0.0" + "revision" : "6319be3a8a52024c62cec4320e94536b51f427ee", + "version" : "207.0.0" } }, { @@ -75,7 +75,7 @@ { "identity" : "lottie-spm", "kind" : "remoteSourceControl", - "location" : "https://github.com/airbnb/lottie-spm", + "location" : "https://github.com/airbnb/lottie-spm.git", "state" : { "revision" : "1d29eccc24cc8b75bff9f6804155112c0ffc9605", "version" : "4.4.3" diff --git a/DuckDuckGo/Tab/TabExtensions/AdClickAttributionTabExtension.swift b/DuckDuckGo/Tab/TabExtensions/AdClickAttributionTabExtension.swift index 7194db2d29..86c7399755 100644 --- a/DuckDuckGo/Tab/TabExtensions/AdClickAttributionTabExtension.swift +++ b/DuckDuckGo/Tab/TabExtensions/AdClickAttributionTabExtension.swift @@ -25,6 +25,7 @@ import Navigation import PrivacyDashboard import TrackerRadarKit import WebKit +import os.log protocol AdClickAttributionDependencies { @@ -61,6 +62,8 @@ protocol AdClickLogicProtocol: AnyObject { var state: AdClickAttributionLogic.State { get } var delegate: AdClickAttributionLogicDelegate? { get set } + var debugID: String { get } + func applyInheritedAttribution(state: AdClickAttributionLogic.State?) func onRulesChanged(latestRules: [ContentBlockerRulesManager.Rules]) func onRequestDetected(request: DetectedRequest) @@ -131,6 +134,8 @@ final class AdClickAttributionTabExtension: TabExtension { self.dependencies = dependencies self.dateTimeProvider = dateTimeProvider (self.logic, self.detection) = logicsProvider(dependencies) + + Logger.contentBlocking.debug("<\(self.logic.debugID)> AttributionLogic created in Tab Extension") self.logic.delegate = self // delay firing up until UserContentController is published @@ -144,6 +149,8 @@ final class AdClickAttributionTabExtension: TabExtension { private func delayedInitialization(with userContentController: UserContentControllerProtocol, inheritedAttribution: AdClickAttributionLogic.State?, contentBlockerRulesScriptPublisher: some Publisher<(any ContentBlockerScriptProtocol)?, Never>, trackerInfoPublisher: some Publisher) { + Logger.contentBlocking.debug("<\(self.logic.debugID)> Performing delayed initialization") + cancellables.removeAll() self.userContentController = userContentController @@ -180,6 +187,8 @@ extension AdClickAttributionTabExtension: AdClickAttributionLogicDelegate { return } + Logger.contentBlocking.debug("<\(self.logic.debugID)> Attribution requesting Rule application for \(vendor ?? "")") + let attributedTempListName = AdClickAttributionRulesProvider.Constants.attributedTempRuleListName guard dependencies.privacyConfigurationManager.privacyConfig.isEnabled(featureKey: .contentBlocking) else { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index bff05db407..520f3a0fc1 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "206.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "207.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../AppKitExtensions"), .package(path: "../XPCHelper"), diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 0505546d5f..1bc2b398b5 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "206.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "207.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 62900e2862..8c90f8863b 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "206.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "207.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/UnitTests/TabExtensionsTests/AdClickAttributionTabExtensionTests.swift b/UnitTests/TabExtensionsTests/AdClickAttributionTabExtensionTests.swift index 8b15ebdc5a..744a35196e 100644 --- a/UnitTests/TabExtensionsTests/AdClickAttributionTabExtensionTests.swift +++ b/UnitTests/TabExtensionsTests/AdClickAttributionTabExtensionTests.swift @@ -705,6 +705,8 @@ class MockAdClickLogic: AdClickLogicProtocol { self.delegate!.attributionLogic(castedLogic, didRequestRuleApplication: .init(name: "rulesList", rulesList: ruleList, trackerData: .mock, encodedTrackerData: "etd", etag: "etag", identifier: .mock), forVendor: "vnd") } + var debugID = "test" + var onRulesChanged: (([ContentBlockerRulesManager.Rules]) -> Void)? func onRulesChanged(latestRules: [ContentBlockerRulesManager.Rules]) { onRulesChanged?(latestRules) @@ -802,8 +804,8 @@ extension AdClickAttributionLogic.State: Equatable { case .noAttribution: if case .noAttribution = rhs { return true } case .activeAttribution(vendor: let vendor, session: let session, rules: let rules): if case .activeAttribution(vendor: vendor, session: session, rules: rules) = rhs { return true } - case .preparingAttribution(vendor: let vendor, session: let session, completionBlocks: _): - if case .preparingAttribution(vendor: vendor, session: session, completionBlocks: _) = rhs { return true } + case .preparingAttribution(vendor: let vendor, session: let session, let id, completionBlocks: _): + if case .preparingAttribution(vendor: vendor, session: session, requestID: id, completionBlocks: _) = rhs { return true } } return false }