From 35b7a452d3028428033b1ff29ac878bbe0a858ea Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Mon, 16 Sep 2024 06:29:23 -0500 Subject: [PATCH] Add privacy config version to broken site reports (#3351) --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/AutofillLoginListViewModel.swift | 1 + .../PrivacyDashboard/PrivacyDashboardViewController.swift | 1 + DuckDuckGoTests/BrokenSiteReportingTests.swift | 2 ++ DuckDuckGoTests/MockPrivacyConfiguration.swift | 1 + DuckDuckGoTests/PrivacyConfigurationManagerMock.swift | 1 + 7 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 23688459f1..4fc50dc02a 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10885,7 +10885,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 195.0.0; + version = 196.0.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d785772d67..1fc9b47178 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" : "f9134f887b1215779a1050134d09d7e824a8abc0", - "version" : "195.0.0" + "revision" : "ae3dbec01b8b72dc2ea4c510aecbc802862eab63", + "version" : "196.0.0" } }, { diff --git a/DuckDuckGo/AutofillLoginListViewModel.swift b/DuckDuckGo/AutofillLoginListViewModel.swift index 0bf99e6fe1..c244f97752 100644 --- a/DuckDuckGo/AutofillLoginListViewModel.swift +++ b/DuckDuckGo/AutofillLoginListViewModel.swift @@ -362,6 +362,7 @@ final class AutofillLoginListViewModel: ObservableObject { manufacturer: "", upgradedHttps: false, tdsETag: nil, + configVersion: nil, blockedTrackerDomains: nil, installedSurrogates: nil, isGPCEnabled: true, diff --git a/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift b/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift index f16e209939..1c3161a27f 100644 --- a/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift +++ b/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift @@ -356,6 +356,7 @@ extension PrivacyDashboardViewController { manufacturer: "Apple", upgradedHttps: breakageAdditionalInfo.httpsForced, tdsETag: ContentBlocking.shared.contentBlockingManager.currentMainRules?.etag ?? "", + configVersion: privacyConfigurationManager.privacyConfig.version, blockedTrackerDomains: blockedTrackerDomains, installedSurrogates: privacyInfo.trackerInfo.installedSurrogates.map { $0 }, isGPCEnabled: AppDependencyProvider.shared.appSettings.sendDoNotSell, diff --git a/DuckDuckGoTests/BrokenSiteReportingTests.swift b/DuckDuckGoTests/BrokenSiteReportingTests.swift index a99c8b8f1f..708c5d59d8 100644 --- a/DuckDuckGoTests/BrokenSiteReportingTests.swift +++ b/DuckDuckGoTests/BrokenSiteReportingTests.swift @@ -102,6 +102,7 @@ final class BrokenSiteReportingTests: XCTestCase { manufacturer: test.manufacturer ?? "", upgradedHttps: test.wasUpgraded, tdsETag: test.blocklistVersion, + configVersion: test.remoteConfigVersion, blockedTrackerDomains: test.blockedTrackers, installedSurrogates: test.surrogates, isGPCEnabled: test.gpcEnabled ?? false, @@ -169,6 +170,7 @@ private struct Test: Codable { let providedDescription: String? let blockedTrackers, surrogates: [String] let atb, blocklistVersion: String + let remoteConfigVersion: String? let expectReportURLPrefix: String let expectReportURLParams: [ExpectReportURLParam] let exceptPlatforms: [String] diff --git a/DuckDuckGoTests/MockPrivacyConfiguration.swift b/DuckDuckGoTests/MockPrivacyConfiguration.swift index 1053217167..3066b1c3a6 100644 --- a/DuckDuckGoTests/MockPrivacyConfiguration.swift +++ b/DuckDuckGoTests/MockPrivacyConfiguration.swift @@ -36,6 +36,7 @@ class MockPrivacyConfiguration: PrivacyConfiguration { } var identifier: String = "MockPrivacyConfiguration" + var version: String? = "123456789" var userUnprotectedDomains: [String] = [] var tempUnprotectedDomains: [String] = [] var trackerAllowlist: PrivacyConfigurationData.TrackerAllowlist = .init(entries: [:], diff --git a/DuckDuckGoTests/PrivacyConfigurationManagerMock.swift b/DuckDuckGoTests/PrivacyConfigurationManagerMock.swift index 15c9b403ab..d50a621f91 100644 --- a/DuckDuckGoTests/PrivacyConfigurationManagerMock.swift +++ b/DuckDuckGoTests/PrivacyConfigurationManagerMock.swift @@ -24,6 +24,7 @@ import BrowserServicesKit class PrivacyConfigurationMock: PrivacyConfiguration { var identifier: String = "id" + var version: String? = "123456789" var userUnprotectedDomains: [String] = []