From 473387828a88fa534b63da6663db153ee13cc024 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Wed, 14 Feb 2024 15:51:55 -0600 Subject: [PATCH 1/9] track last error status and add to breakage report --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 3 +-- .../View/PrivacyDashboardViewController.swift | 13 +++++++++++-- DuckDuckGo/Tab/Model/Tab.swift | 12 ++++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 51e2f0b5c3..35f8b35d59 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13352,8 +13352,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 107.0.0; + kind = revision; + revision = 78caab092cbda6b2f5b5f43430e2ae4e137b9ebd; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 954bc34c8c..075134b65c 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "328ce451fd1593809d1470ab5a0b5242a595f88c", - "version" : "107.0.0" + "revision" : "78caab092cbda6b2f5b5f43430e2ae4e137b9ebd" } }, { diff --git a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift index 86765ea05e..2a15c5f818 100644 --- a/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift +++ b/DuckDuckGo/PrivacyDashboard/View/PrivacyDashboardViewController.swift @@ -274,6 +274,15 @@ extension PrivacyDashboardViewController { let configuration = ContentBlocking.shared.privacyConfigurationManager.privacyConfig let protectionsState = configuration.isFeature(.contentBlocking, enabledForDomain: currentTab.content.url?.host) + var errors: [Error]? + var statusCodes: [Int]? + if let error = tabViewModel?.tab.lastWebError { + errors = [error] + } + if let httpStatusCode = tabViewModel?.tab.lastHttpStatusCode { + statusCodes = [httpStatusCode] + } + let websiteBreakage = WebsiteBreakage(siteUrl: currentURL, category: category.lowercased(), description: description, @@ -288,8 +297,8 @@ extension PrivacyDashboardViewController { urlParametersRemoved: urlParametersRemoved, protectionsState: protectionsState, reportFlow: source, - error: nil, - httpStatusCode: nil) + errors: errors, + httpStatusCodes: statusCodes) return websiteBreakage } } diff --git a/DuckDuckGo/Tab/Model/Tab.swift b/DuckDuckGo/Tab/Model/Tab.swift index f2c35a5a18..2a9eadf65b 100644 --- a/DuckDuckGo/Tab/Model/Tab.swift +++ b/DuckDuckGo/Tab/Model/Tab.swift @@ -694,6 +694,9 @@ protocol NewWindowPolicyDecisionMaker { } let permissions: PermissionModel + @Published private(set) var lastWebError: Error? + @Published private(set) var lastHttpStatusCode: Int? + @Published private(set) var isLoading: Bool = false @Published private(set) var loadingProgress: Double = 0.0 @@ -1173,6 +1176,7 @@ extension Tab/*: NavigationResponder*/ { // to be moved to Tab+Navigation.swift @MainActor func willStart(_ navigation: Navigation) { if error != nil { error = nil } + if lastWebError != nil { lastWebError = nil } delegate?.tabWillStartNavigation(self, isUserInitiated: navigation.navigationAction.isUserInitiated) } @@ -1182,6 +1186,8 @@ extension Tab/*: NavigationResponder*/ { // to be moved to Tab+Navigation.swift internalUserDecider?.markUserAsInternalIfNeeded(forUrl: webView.url, response: navigationResponse.response as? HTTPURLResponse) + lastHttpStatusCode = navigationResponse.httpStatusCode + return .next } @@ -1193,6 +1199,7 @@ extension Tab/*: NavigationResponder*/ { // to be moved to Tab+Navigation.swift // Unnecessary assignment triggers publishing if error != nil { error = nil } + if lastWebError != nil { lastWebError = nil } invalidateInteractionStateData() } @@ -1220,6 +1227,11 @@ extension Tab/*: NavigationResponder*/ { // to be moved to Tab+Navigation.swift webViewDidFailNavigationPublisher.send() } + @MainActor + func didFailProvisionalLoad(with request: URLRequest, in frame: WKFrameInfo, with error: Error) { + lastWebError = error + } + func webContentProcessDidTerminate(with reason: WKProcessTerminationReason?) { Pixel.fire(.debug(event: .webKitDidTerminate, error: NSError(domain: "WKProcessTerminated", code: reason?.rawValue ?? -1))) } From 6490a5385ff397302237d39fc0ee245502e8974a Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 15 Feb 2024 09:40:42 -0600 Subject: [PATCH 2/9] Fix tests --- .../BrokenSiteReportingReferenceTests.swift | 4 ++-- .../WebsiteBreakageReportTests.swift | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift index 826682a1aa..99057031b8 100644 --- a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift +++ b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift @@ -67,8 +67,8 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { urlParametersRemoved: false, protectionsState: test.protectionsEnabled, reportFlow: .appMenu, - error: nil, - httpStatusCode: nil) + errors: nil, + httpStatusCodes: nil) let request = makeURLRequest(with: breakage.requestParameters) diff --git a/UnitTests/WebsiteBreakageReport/WebsiteBreakageReportTests.swift b/UnitTests/WebsiteBreakageReport/WebsiteBreakageReportTests.swift index 33132f8c3b..c0c006e124 100644 --- a/UnitTests/WebsiteBreakageReport/WebsiteBreakageReportTests.swift +++ b/UnitTests/WebsiteBreakageReport/WebsiteBreakageReportTests.swift @@ -44,8 +44,8 @@ class WebsiteBreakageReportTests: XCTestCase { urlParametersRemoved: false, protectionsState: true, reportFlow: .appMenu, - error: nil, - httpStatusCode: nil + errors: nil, + httpStatusCodes: nil ) let urlRequest = makeURLRequest(with: breakage.requestParameters) @@ -87,8 +87,8 @@ class WebsiteBreakageReportTests: XCTestCase { urlParametersRemoved: false, protectionsState: true, reportFlow: .appMenu, - error: nil, - httpStatusCode: nil + errors: nil, + httpStatusCodes: nil ) let urlRequest = makeURLRequest(with: breakage.requestParameters) From ff6c40f90093f9102761ff8b36b5623625239714 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 15 Feb 2024 10:00:49 -0600 Subject: [PATCH 3/9] Update BSK --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- LocalPackages/SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 35f8b35d59..57994c2d11 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13353,7 +13353,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 78caab092cbda6b2f5b5f43430e2ae4e137b9ebd; + revision = 104ad60a0daa73720c665cbdb9bca894ab6c6af6; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 075134b65c..b362e703aa 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "78caab092cbda6b2f5b5f43430e2ae4e137b9ebd" + "revision" : "104ad60a0daa73720c665cbdb9bca894ab6c6af6" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index d791a1d36c..1fc7044dde 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: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index ba1b067330..233fbd7fcd 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index b461a64cc3..66efc40fba 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), .package(path: "../LoginItems") diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index fa0471614f..9ef0cf1e09 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ .target( diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 0070342a36..1dc709e6b7 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: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index b39d10d9e1..01e159a1ae 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -11,7 +11,7 @@ let package = Package( .library(name: "PreferencesViews", targets: ["PreferencesViews"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 56579428b8..670c5ec316 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 9eb46d11a9..af8cac10ba 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index dbfc4d9353..2c683cb3f0 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "107.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), ], targets: [ .target( From d08b4469a56124d65134e6c6102974a412dd40e9 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 15 Feb 2024 11:32:44 -0600 Subject: [PATCH 4/9] Fix breakage report tests --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- .../NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- .../SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- Submodules/privacy-reference-tests | 2 +- .../BrokenSiteReportingReferenceTests.swift | 44 ++++++++++++++++--- 13 files changed, 51 insertions(+), 17 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 57994c2d11..e5bdb33d31 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13353,7 +13353,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 104ad60a0daa73720c665cbdb9bca894ab6c6af6; + revision = c92ba4693258d043fe78ef53d1e07a688b0d6fda; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b362e703aa..cae6e2e19d 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "104ad60a0daa73720c665cbdb9bca894ab6c6af6" + "revision" : "c92ba4693258d043fe78ef53d1e07a688b0d6fda" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 1fc7044dde..4c62aab6e1 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", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index 233fbd7fcd..f5ba92680a 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 66efc40fba..db84f24c03 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), .package(path: "../LoginItems") diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 9ef0cf1e09..aaff99b602 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ .target( diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 1dc709e6b7..375350252f 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", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 01e159a1ae..51a6a5d4d0 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -11,7 +11,7 @@ let package = Package( .library(name: "PreferencesViews", targets: ["PreferencesViews"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 670c5ec316..6a13b2a46c 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index af8cac10ba..36567139d6 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 2c683cb3f0..2ecfead677 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "104ad60a0daa73720c665cbdb9bca894ab6c6af6"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), ], targets: [ .target( diff --git a/Submodules/privacy-reference-tests b/Submodules/privacy-reference-tests index 6b7ad1e7f1..237e4f976a 160000 --- a/Submodules/privacy-reference-tests +++ b/Submodules/privacy-reference-tests @@ -1 +1 @@ -Subproject commit 6b7ad1e7f15270f9dfeb58a272199f4d57c3eb22 +Subproject commit 237e4f976aed8df2efa808dac1d315c4dc5d431a diff --git a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift index 99057031b8..a12526ed25 100644 --- a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift +++ b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift @@ -27,6 +27,22 @@ import PrivacyDashboard final class BrokenSiteReportingReferenceTests: XCTestCase { private let testHelper = PrivacyReferenceTestHelper() + struct MockError: LocalizedError { + let description: String + + init(_ description: String) { + self.description = description + } + + var errorDescription: String? { + description + } + + var localizedDescription: String? { + description + } + } + private enum Resource { static let tests = "privacy-reference-tests/broken-site-reporting/tests.json" } @@ -53,9 +69,18 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { os_log("Testing [%s]", type: .info, test.name) + var errors: [Error]? + var statusCodes: [Int]? + if let error = test.errorDescription { + errors = [MockError(error)] + } + if let httpStatusCode = test.httpStatusCode { + statusCodes = [httpStatusCode] + } + let breakage = WebsiteBreakage(siteUrl: test.siteURL, - category: "test", - description: "description", + category: test.category, + description: test.providedDescription, osVersion: test.os ?? "", manufacturer: "Apple", upgradedHttps: test.wasUpgraded, @@ -67,8 +92,8 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { urlParametersRemoved: false, protectionsState: test.protectionsEnabled, reportFlow: .appMenu, - errors: nil, - httpStatusCodes: nil) + errors: errors, + httpStatusCodes: statusCodes) let request = makeURLRequest(with: breakage.requestParameters) @@ -94,7 +119,13 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { let match = regex.matches(in: absoluteURL, range: NSRange(location: 0, length: absoluteURL.count)) - XCTAssertEqual(match.count, 1, "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") + if param.name == "errorDescriptions" { + // `localizedDescription` adds class information to the error. The value is not standardized across platforms + // so we'll just check for the content instead + XCTAssert(absoluteURL.contains(param.value.percentEncoded(withAllowedCharacters: .alphanumerics)), "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") + } else { + XCTAssertEqual(match.count, 1, "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") + } } } } @@ -121,6 +152,7 @@ private struct Test: Codable { let siteURL: URL let wasUpgraded: Bool let category: String + let providedDescription: String? let blockedTrackers, surrogates: [String] let atb, blocklistVersion: String let expectReportURLPrefix: String @@ -129,6 +161,8 @@ private struct Test: Codable { let manufacturer, model, os: String? let gpcEnabled: Bool? let protectionsEnabled: Bool + let errorDescription: String? + let httpStatusCode: Int? } // MARK: - ExpectReportURLParam From be59461a0f7b2d592426f8f732a6b7d077941c53 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 15 Feb 2024 12:53:21 -0600 Subject: [PATCH 5/9] Assert param name exists for error descriptions --- .../BrokenSiteReportingReferenceTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift index a12526ed25..ad1e96bf00 100644 --- a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift +++ b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift @@ -122,6 +122,7 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { if param.name == "errorDescriptions" { // `localizedDescription` adds class information to the error. The value is not standardized across platforms // so we'll just check for the content instead + XCTAssert(absoluteURL.contains("\(param.name)="), "Param [\(param.name)] not found in [\(absoluteURL)]") XCTAssert(absoluteURL.contains(param.value.percentEncoded(withAllowedCharacters: .alphanumerics)), "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") } else { XCTAssertEqual(match.count, 1, "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") From e51e5c6a668621b5d01fdc0bf41eeba2f5e20842 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 22 Feb 2024 09:33:19 -0600 Subject: [PATCH 6/9] Fix tests --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- .../NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- .../SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- Submodules/privacy-reference-tests | 2 +- .../BrokenSiteReportingReferenceTests.swift | 29 +++++++++++-------- 13 files changed, 29 insertions(+), 24 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index e5bdb33d31..3809044a78 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13353,7 +13353,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = c92ba4693258d043fe78ef53d1e07a688b0d6fda; + revision = 5e323aaa1fb1e2a41b331704f021850b9421afd1; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index cae6e2e19d..ab15911972 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "c92ba4693258d043fe78ef53d1e07a688b0d6fda" + "revision" : "5e323aaa1fb1e2a41b331704f021850b9421afd1" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 4c62aab6e1..db034574a0 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", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index f5ba92680a..218c23b1ec 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index db84f24c03..a7d902134d 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), .package(path: "../LoginItems") diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index aaff99b602..5bc864cc11 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ .target( diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 375350252f..8340c38d73 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", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 51a6a5d4d0..7b169b2e28 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -11,7 +11,7 @@ let package = Package( .library(name: "PreferencesViews", targets: ["PreferencesViews"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 6a13b2a46c..13ed6294cf 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 36567139d6..37c2246fa1 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 2ecfead677..3f4d025b7d 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "c92ba4693258d043fe78ef53d1e07a688b0d6fda"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), ], targets: [ .target( diff --git a/Submodules/privacy-reference-tests b/Submodules/privacy-reference-tests index 237e4f976a..40ce86837d 160000 --- a/Submodules/privacy-reference-tests +++ b/Submodules/privacy-reference-tests @@ -1 +1 @@ -Subproject commit 237e4f976aed8df2efa808dac1d315c4dc5d431a +Subproject commit 40ce86837def0adbf558f00ed0531ab4df5839a8 diff --git a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift index ad1e96bf00..73e7cba06c 100644 --- a/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift +++ b/UnitTests/PrivacyReferenceTests/BrokenSiteReportingReferenceTests.swift @@ -70,12 +70,8 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { os_log("Testing [%s]", type: .info, test.name) var errors: [Error]? - var statusCodes: [Int]? - if let error = test.errorDescription { - errors = [MockError(error)] - } - if let httpStatusCode = test.httpStatusCode { - statusCodes = [httpStatusCode] + if let errs = test.errorDescriptions { + errors = errs.map { MockError($0) } } let breakage = WebsiteBreakage(siteUrl: test.siteURL, @@ -93,7 +89,7 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { protectionsState: test.protectionsEnabled, reportFlow: .appMenu, errors: errors, - httpStatusCodes: statusCodes) + httpStatusCodes: test.httpErrorCodes ?? []) let request = makeURLRequest(with: breakage.requestParameters) @@ -121,9 +117,18 @@ final class BrokenSiteReportingReferenceTests: XCTestCase { if param.name == "errorDescriptions" { // `localizedDescription` adds class information to the error. The value is not standardized across platforms - // so we'll just check for the content instead - XCTAssert(absoluteURL.contains("\(param.name)="), "Param [\(param.name)] not found in [\(absoluteURL)]") - XCTAssert(absoluteURL.contains(param.value.percentEncoded(withAllowedCharacters: .alphanumerics)), "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") + // so we'll just check the result is an array of strings + guard let params = URLComponents(string: absoluteURL)?.queryItems else { + XCTFail("Unable to parse query parameters from \(absoluteURL)") + return + } + var errorsFound = false + for queryItem in params { + if queryItem.name != param.name { continue } + errorsFound = true + XCTAssert((queryItem.value?.split(separator: ",").count ?? 0) > 1, "Error descriptions should return an array of strings. Parsed: \(queryItem.value ?? "")") + } + XCTAssert(errorsFound, "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") } else { XCTAssertEqual(match.count, 1, "Param [\(param.name)] with value [\(param.value)] not found in [\(absoluteURL)]") } @@ -162,8 +167,8 @@ private struct Test: Codable { let manufacturer, model, os: String? let gpcEnabled: Bool? let protectionsEnabled: Bool - let errorDescription: String? - let httpStatusCode: Int? + let errorDescriptions: [String]? + let httpErrorCodes: [Int]? } // MARK: - ExpectReportURLParam From 91515cca46d0f9b9ca0d28163cb5855cabf40835 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 22 Feb 2024 09:37:03 -0600 Subject: [PATCH 7/9] Update BSK --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- LocalPackages/SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 3809044a78..d31bc359d0 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13353,7 +13353,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 5e323aaa1fb1e2a41b331704f021850b9421afd1; + revision = aea703f144eca1116a8019fb5bd4f1fcbdb4b45c; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ab15911972..feb7467ef7 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "5e323aaa1fb1e2a41b331704f021850b9421afd1" + "revision" : "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index db034574a0..416dcdc778 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", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index 218c23b1ec..c7c87f086b 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index a7d902134d..a0a0df680d 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), .package(path: "../LoginItems") diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 5bc864cc11..483c84957c 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ .target( diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 8340c38d73..4416d32771 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", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 7b169b2e28..8fcc1f2a67 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -11,7 +11,7 @@ let package = Package( .library(name: "PreferencesViews", targets: ["PreferencesViews"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 13ed6294cf..60f1f98cc3 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 37c2246fa1..60b3a76cfb 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 3f4d025b7d..f9a1d6143f 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "5e323aaa1fb1e2a41b331704f021850b9421afd1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), ], targets: [ .target( From 9b07f660ada2ceccbb793ad663aac7777f9be0b0 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 22 Feb 2024 12:58:55 -0600 Subject: [PATCH 8/9] Pin BSK version --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 7 ++++--- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- LocalPackages/SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d31bc359d0..834ada47ce 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13352,8 +13352,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = revision; - revision = aea703f144eca1116a8019fb5bd4f1fcbdb4b45c; + kind = exactVersion; + version = 110.0.0; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index feb7467ef7..eacf6dee47 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c" + "revision" : "d56b90bd229288f681f0a3a6a325ef25e3ce5f3c", + "version" : "110.0.0" } }, { @@ -22,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "063b560e59a50e03d9b00b88a7fcb2ed2b562395", - "version" : "4.61.0" + "revision" : "36ddba2cbac52a41b9a9275af06d32fa8a56d2d7", + "version" : "4.64.0" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 416dcdc778..eb8aa9d0c8 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", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index c7c87f086b..298688d204 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index a0a0df680d..18d2ba42c6 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), .package(path: "../LoginItems") diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 483c84957c..dfb0e4deed 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 4416d32771..ac79aa79e0 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", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [ diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 8fcc1f2a67..0eb22b5831 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -11,7 +11,7 @@ let package = Package( .library(name: "PreferencesViews", targets: ["PreferencesViews"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 60f1f98cc3..8235911de7 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 60b3a76cfb..717e820512 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index f9a1d6143f..ef2510badf 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", revision: "aea703f144eca1116a8019fb5bd4f1fcbdb4b45c"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "110.0.0"), ], targets: [ .target( From 4d2a2241f52300a1280b336c9b32c37280705abd Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Thu, 22 Feb 2024 13:44:03 -0600 Subject: [PATCH 9/9] Fix accidental file change --- DuckDuckGo/InfoPlist.xcstrings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuckDuckGo/InfoPlist.xcstrings b/DuckDuckGo/InfoPlist.xcstrings index 4d7c2d94c0..70d7389fb7 100644 --- a/DuckDuckGo/InfoPlist.xcstrings +++ b/DuckDuckGo/InfoPlist.xcstrings @@ -8,7 +8,7 @@ "en" : { "stringUnit" : { "state" : "new", - "value" : "DuckDuckGo" + "value" : "DuckDuckGo Privacy Pro" } } }