From 0c407f0cac7879da0237e5904c393ccd525a5084 Mon Sep 17 00:00:00 2001 From: Federico Cappelli Date: Fri, 17 Jan 2025 11:31:27 +0000 Subject: [PATCH 1/3] BSK update with Networking v2 and testing utils refactoring --- DuckDuckGo.xcodeproj/project.pbxproj | 101 ++++++++++++++---- .../xcshareddata/swiftpm/Package.resolved | 31 +++++- .../AppLifecycle/AppStates/Launching.swift | 6 +- .../UnifiedFeedbackFormViewModel.swift | 5 +- .../AdAttributionFetcherTests.swift | 3 +- ...tocompleteSuggestionsDataSourceTests.swift | 2 +- .../AutofillLoginListViewModelTests.swift | 2 +- .../AutofillVaultKeychainMigratorTests.swift | 2 +- .../BookmarkStateRepairTests.swift | 2 +- .../BookmarksDatabaseSetupTests.swift | 2 +- .../BookmarksStateValidationTests.swift | 2 +- .../BrokenSiteReportingTests.swift | 2 +- DuckDuckGoTests/DailyPixelTests.swift | 2 +- .../FireButtonReferenceTests.swift | 2 +- DuckDuckGoTests/PersistentPixelTests.swift | 2 +- .../UsageSegmentationStorageTests.swift | 2 +- WebViewUnitTests/CookieStorageTests.swift | 2 +- .../DataStoreIDManagerTests.swift | 2 +- WebViewUnitTests/WebCacheManagerTests.swift | 2 +- 19 files changed, 137 insertions(+), 37 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index a4d1f61d75..863377de6e 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -690,7 +690,6 @@ 98424A982CED4F430071C7DB /* ContentBlocking in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C62CED4F430071C7DB /* ContentBlocking */; }; 98424A992CED4F430071C7DB /* SubscriptionTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C92CED4F430071C7DB /* SubscriptionTestingUtilities */; }; 98424A9A2CED4F430071C7DB /* Subscription in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C82CED4F430071C7DB /* Subscription */; }; - 98424A9B2CED4F430071C7DB /* TestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C52CED4F430071C7DB /* TestUtils */; }; 98424A9C2CED4F430071C7DB /* NetworkProtectionTestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C32CED4F430071C7DB /* NetworkProtectionTestUtils */; }; 98424A9D2CED4F430071C7DB /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 984249C72CED4F430071C7DB /* Common */; }; 98424AAB2CED4FF10071C7DB /* CookieStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85AD49ED2B6149110085D2D1 /* CookieStorageTests.swift */; }; @@ -1165,7 +1164,6 @@ F1134ED21F40EF3A00B73467 /* JsonTestDataLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1134ECF1F40EBE200B73467 /* JsonTestDataLoader.swift */; }; F1134ED61F40F29F00B73467 /* StatisticsUserDefaultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1134ED41F40F15800B73467 /* StatisticsUserDefaultsTests.swift */; }; F114C55B1E66EB020018F95F /* NibLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = F114C55A1E66EB020018F95F /* NibLoading.swift */; }; - F115ED9C2B4EFC8E001A0453 /* TestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = F115ED9B2B4EFC8E001A0453 /* TestUtils */; }; F130D73A1E5776C500C45811 /* OmniBarDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F130D7391E5776C500C45811 /* OmniBarDelegate.swift */; }; F132D6A52C62239B00D85426 /* SubscriptionSettingsHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F132D6A42C62239B00D85426 /* SubscriptionSettingsHeaderView.swift */; }; F1386BA41E6846C40062FC3C /* TabDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1386BA31E6846C40062FC3C /* TabDelegate.swift */; }; @@ -1207,6 +1205,18 @@ F198D78E1E39762C0088DA8A /* StringExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F198D78D1E39762C0088DA8A /* StringExtensionTests.swift */; }; F1A886781F29394E0096251E /* WebCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A886771F29394E0096251E /* WebCacheManager.swift */; }; F1AE54E81F0425FC00D9A700 /* AuthenticationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1AE54E71F0425FC00D9A700 /* AuthenticationViewController.swift */; }; + F1B3084F2D3A721400755104 /* PersistenceTestingUtils in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3084E2D3A721400755104 /* PersistenceTestingUtils */; }; + F1B308512D3A721B00755104 /* PersistenceTestingUtils in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308502D3A721B00755104 /* PersistenceTestingUtils */; }; + F1B308532D3A725600755104 /* Persistence in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308522D3A725600755104 /* Persistence */; }; + F1B308552D3A726B00755104 /* Networking in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308542D3A726B00755104 /* Networking */; }; + F1B308572D3A727F00755104 /* Persistence in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308562D3A727F00755104 /* Persistence */; }; + F1B308592D3A729500755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308582D3A729500755104 /* BrowserServicesKit */; }; + F1B3085D2D3A72CC00755104 /* SecureStorage in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3085C2D3A72CC00755104 /* SecureStorage */; }; + F1B3085F2D3A72DE00755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3085E2D3A72DE00755104 /* BrowserServicesKit */; }; + F1B308612D3A752E00755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308602D3A752E00755104 /* BrowserServicesKit */; }; + F1B308652D3A755400755104 /* PixelKitTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308642D3A755400755104 /* PixelKitTestingUtilities */; }; + F1B308692D3A75D500755104 /* SecureStorage in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308682D3A75D500755104 /* SecureStorage */; }; + F1B3086B2D3A762A00755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3086A2D3A762A00755104 /* BrowserServicesKit */; }; F1BDDBFD2C340D9C00459306 /* SubscriptionContainerViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBF92C340D9C00459306 /* SubscriptionContainerViewModelTests.swift */; }; F1BDDBFE2C340D9C00459306 /* SubscriptionFlowViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBFA2C340D9C00459306 /* SubscriptionFlowViewModelTests.swift */; }; F1BDDBFF2C340D9C00459306 /* SubscriptionPagesUseSubscriptionFeatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBFB2C340D9C00459306 /* SubscriptionPagesUseSubscriptionFeatureTests.swift */; }; @@ -3236,7 +3246,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F1B308592D3A729500755104 /* BrowserServicesKit in Frameworks */, 02025664298818B200E694E7 /* NetworkExtension.framework in Frameworks */, + F1B308572D3A727F00755104 /* Persistence in Frameworks */, 4B45D85C2BE0B115006061B5 /* Subscription in Frameworks */, 4B470EE4299C6DFB0086EBDC /* Core.framework in Frameworks */, 4BC8948C2C7902E6009AA141 /* WireGuard in Frameworks */, @@ -3287,12 +3299,14 @@ buildActionMask = 2147483647; files = ( F486D3362506A037002D07D7 /* OHHTTPStubs in Frameworks */, + F1B308692D3A75D500755104 /* SecureStorage in Frameworks */, F486D3382506A225002D07D7 /* OHHTTPStubsSwift in Frameworks */, 4BE67B052B96B9AB007335F7 /* ContentBlocking in Frameworks */, + F1B308512D3A721B00755104 /* PersistenceTestingUtils in Frameworks */, F15531922BF215ED0029ED04 /* SubscriptionTestingUtilities in Frameworks */, F15531902BF215ED0029ED04 /* Subscription in Frameworks */, - F115ED9C2B4EFC8E001A0453 /* TestUtils in Frameworks */, EEFAB4672A73C230008A38E4 /* NetworkProtectionTestUtils in Frameworks */, + F1B3086B2D3A762A00755104 /* BrowserServicesKit in Frameworks */, 4BE67B072B96B9B0007335F7 /* Common in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3303,6 +3317,7 @@ files = ( 8512EA5124ED30D20073EE19 /* SwiftUI.framework in Frameworks */, 4BD96E062C4DBC93003BC32C /* NetworkExtension.framework in Frameworks */, + F1B308532D3A725600755104 /* Persistence in Frameworks */, 85DF714624F7FE6100C89288 /* Core.framework in Frameworks */, 7B2CCBA32D11ABB100FE5852 /* VPNWidgetSupport in Frameworks */, 8512EA4F24ED30D20073EE19 /* WidgetKit.framework in Frameworks */, @@ -3324,6 +3339,8 @@ files = ( 1E1D8B632995143200C96994 /* OHHTTPStubs in Frameworks */, 1E1D8B652995143200C96994 /* OHHTTPStubsSwift in Frameworks */, + F1B308652D3A755400755104 /* PixelKitTestingUtilities in Frameworks */, + F1B308612D3A752E00755104 /* BrowserServicesKit in Frameworks */, 4BE67B012B96B741007335F7 /* Common in Frameworks */, F15531962BF215F60029ED04 /* SubscriptionTestingUtilities in Frameworks */, F15531942BF215F60029ED04 /* Subscription in Frameworks */, @@ -3357,9 +3374,9 @@ 98424A972CED4F430071C7DB /* OHHTTPStubsSwift in Frameworks */, 98424A982CED4F430071C7DB /* ContentBlocking in Frameworks */, 98424AB22CEDD6150071C7DB /* BrowserServicesKit in Frameworks */, + F1B3084F2D3A721400755104 /* PersistenceTestingUtils in Frameworks */, 98424A992CED4F430071C7DB /* SubscriptionTestingUtilities in Frameworks */, 98424A9A2CED4F430071C7DB /* Subscription in Frameworks */, - 98424A9B2CED4F430071C7DB /* TestUtils in Frameworks */, 98424A9C2CED4F430071C7DB /* NetworkProtectionTestUtils in Frameworks */, 98424A9D2CED4F430071C7DB /* Common in Frameworks */, ); @@ -3378,8 +3395,11 @@ files = ( C1CAAA812CF8C8F400C37EE6 /* DuckUI in Frameworks */, C1EF5B232CC0457B002980E6 /* AuthenticationServices.framework in Frameworks */, + F1B3085F2D3A72DE00755104 /* BrowserServicesKit in Frameworks */, C1CAAA7B2CF8C8ED00C37EE6 /* Core.framework in Frameworks */, + F1B308552D3A726B00755104 /* Networking in Frameworks */, C1CAAA832CF8C8FF00C37EE6 /* DesignResourcesKit in Frameworks */, + F1B3085D2D3A72CC00755104 /* SecureStorage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6956,6 +6976,8 @@ packageProductDependencies = ( 4B45D85B2BE0B115006061B5 /* Subscription */, 4BC8948B2C7902E6009AA141 /* WireGuard */, + F1B308562D3A727F00755104 /* Persistence */, + F1B308582D3A729500755104 /* BrowserServicesKit */, ); productName = PacketTunnelProvider; productReference = 02025662298818B100E694E7 /* PacketTunnelProvider.appex */; @@ -7066,11 +7088,13 @@ F486D3352506A037002D07D7 /* OHHTTPStubs */, F486D3372506A225002D07D7 /* OHHTTPStubsSwift */, EEFAB4662A73C230008A38E4 /* NetworkProtectionTestUtils */, - F115ED9B2B4EFC8E001A0453 /* TestUtils */, 4BE67B042B96B9AB007335F7 /* ContentBlocking */, 4BE67B062B96B9B0007335F7 /* Common */, F155318F2BF215ED0029ED04 /* Subscription */, F15531912BF215ED0029ED04 /* SubscriptionTestingUtilities */, + F1B308502D3A721B00755104 /* PersistenceTestingUtils */, + F1B308682D3A75D500755104 /* SecureStorage */, + F1B3086A2D3A762A00755104 /* BrowserServicesKit */, ); productName = DuckDuckGoTests; productReference = 84E341A61E2F7EFB00BDBA6F /* UnitTests.xctest */; @@ -7093,6 +7117,7 @@ packageProductDependencies = ( 4BBBBA862B02E85400D965DA /* DesignResourcesKit */, 7B2CCBA22D11ABB100FE5852 /* VPNWidgetSupport */, + F1B308522D3A725600755104 /* Persistence */, ); productName = WidgetsExtension; productReference = 8512EA4D24ED30D20073EE19 /* WidgetsExtension.appex */; @@ -7136,6 +7161,8 @@ 4BE67B022B96B864007335F7 /* ContentBlocking */, F15531932BF215F60029ED04 /* Subscription */, F15531952BF215F60029ED04 /* SubscriptionTestingUtilities */, + F1B308602D3A752E00755104 /* BrowserServicesKit */, + F1B308642D3A755400755104 /* PixelKitTestingUtilities */, ); productName = IntegrationTests; productReference = 85D33FCB25C97B6E002B91A6 /* IntegrationTests.xctest */; @@ -7200,13 +7227,13 @@ 984249C02CED4F430071C7DB /* OHHTTPStubs */, 984249C22CED4F430071C7DB /* OHHTTPStubsSwift */, 984249C32CED4F430071C7DB /* NetworkProtectionTestUtils */, - 984249C52CED4F430071C7DB /* TestUtils */, 984249C62CED4F430071C7DB /* ContentBlocking */, 984249C72CED4F430071C7DB /* Common */, 984249C82CED4F430071C7DB /* Subscription */, 984249C92CED4F430071C7DB /* SubscriptionTestingUtilities */, 98424AB12CEDD6150071C7DB /* BrowserServicesKit */, 98424AB32CEDD61C0071C7DB /* BrowserServicesKitTestsUtils */, + F1B3084E2D3A721400755104 /* PersistenceTestingUtils */, ); productName = DuckDuckGoTests; productReference = 98424AA92CED4F430071C7DB /* WebViewUnitTests.xctest */; @@ -11932,8 +11959,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 224.7.1; + branch = fcappelli/authv2/networking_improvements; + kind = branch; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { @@ -12165,11 +12192,6 @@ package = 984249C42CED4F430071C7DB /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = NetworkProtectionTestUtils; }; - 984249C52CED4F430071C7DB /* TestUtils */ = { - isa = XCSwiftPackageProductDependency; - package = 984249C42CED4F430071C7DB /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = TestUtils; - }; 984249C62CED4F430071C7DB /* ContentBlocking */ = { isa = XCSwiftPackageProductDependency; package = 984249C42CED4F430071C7DB /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; @@ -12287,11 +12309,6 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = NetworkProtectionTestUtils; }; - F115ED9B2B4EFC8E001A0453 /* TestUtils */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = TestUtils; - }; F155318F2BF215ED0029ED04 /* Subscription */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; @@ -12312,6 +12329,54 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = SubscriptionTestingUtilities; }; + F1B3084E2D3A721400755104 /* PersistenceTestingUtils */ = { + isa = XCSwiftPackageProductDependency; + productName = PersistenceTestingUtils; + }; + F1B308502D3A721B00755104 /* PersistenceTestingUtils */ = { + isa = XCSwiftPackageProductDependency; + productName = PersistenceTestingUtils; + }; + F1B308522D3A725600755104 /* Persistence */ = { + isa = XCSwiftPackageProductDependency; + productName = Persistence; + }; + F1B308542D3A726B00755104 /* Networking */ = { + isa = XCSwiftPackageProductDependency; + productName = Networking; + }; + F1B308562D3A727F00755104 /* Persistence */ = { + isa = XCSwiftPackageProductDependency; + productName = Persistence; + }; + F1B308582D3A729500755104 /* BrowserServicesKit */ = { + isa = XCSwiftPackageProductDependency; + productName = BrowserServicesKit; + }; + F1B3085C2D3A72CC00755104 /* SecureStorage */ = { + isa = XCSwiftPackageProductDependency; + productName = SecureStorage; + }; + F1B3085E2D3A72DE00755104 /* BrowserServicesKit */ = { + isa = XCSwiftPackageProductDependency; + productName = BrowserServicesKit; + }; + F1B308602D3A752E00755104 /* BrowserServicesKit */ = { + isa = XCSwiftPackageProductDependency; + productName = BrowserServicesKit; + }; + F1B308642D3A755400755104 /* PixelKitTestingUtilities */ = { + isa = XCSwiftPackageProductDependency; + productName = PixelKitTestingUtilities; + }; + F1B308682D3A75D500755104 /* SecureStorage */ = { + isa = XCSwiftPackageProductDependency; + productName = SecureStorage; + }; + F1B3086A2D3A762A00755104 /* BrowserServicesKit */ = { + isa = XCSwiftPackageProductDependency; + productName = BrowserServicesKit; + }; F1D43AF92B99C1D300BAB743 /* BareBonesBrowserKit */ = { isa = XCSwiftPackageProductDependency; package = F1D43AF82B99C1D300BAB743 /* XCRemoteSwiftPackageReference "BareBonesBrowser" */; diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9b2a92e313..01151c85ca 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" : "5acb297db5c0edabe13c79efa33b1d0e545d6bff", - "version" : "224.7.1" + "branch" : "fcappelli/authv2/networking_improvements", + "revision" : "a99cda2926f489f915a9d988f3a2c96612975f02" } }, { @@ -90,6 +90,15 @@ "version" : "2.0.0" } }, + { + "identity" : "jwt-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/jwt-kit.git", + "state" : { + "revision" : "c2595b9ad7f512d7f334830b4df1fed6e917946a", + "version" : "4.13.4" + } + }, { "identity" : "kingfisher", "kind" : "remoteSourceControl", @@ -144,6 +153,24 @@ "version" : "1.4.0" } }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf", + "version" : "1.3.1" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "ff0f781cf7c6a22d52957e50b104f5768b50c779", + "version" : "3.10.0" + } + }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", diff --git a/DuckDuckGo/AppLifecycle/AppStates/Launching.swift b/DuckDuckGo/AppLifecycle/AppStates/Launching.swift index 2eb3a74e38..36b008e8bd 100644 --- a/DuckDuckGo/AppLifecycle/AppStates/Launching.swift +++ b/DuckDuckGo/AppLifecycle/AppStates/Launching.swift @@ -323,7 +323,11 @@ struct Launching: AppState { let url = URL.pixelUrl(forPixelNamed: pixelName) let apiHeaders = APIRequestV2.HeadersV2(additionalHeaders: headers) - let request = APIRequestV2(url: url, method: .get, queryItems: parameters, headers: apiHeaders) + guard let request = APIRequestV2(url: url, method: .get, queryItems: parameters, headers: apiHeaders) else { + assertionFailure("Invalid request Pixel request") + onComplete(false, nil) + return + } Task { do { _ = try await DefaultAPIService().fetch(request: request) diff --git a/DuckDuckGo/Subscription/Feedback/UnifiedFeedbackFormViewModel.swift b/DuckDuckGo/Subscription/Feedback/UnifiedFeedbackFormViewModel.swift index 6038d19dc2..4409b72219 100644 --- a/DuckDuckGo/Subscription/Feedback/UnifiedFeedbackFormViewModel.swift +++ b/DuckDuckGo/Subscription/Feedback/UnifiedFeedbackFormViewModel.swift @@ -296,7 +296,10 @@ final class UnifiedFeedbackFormViewModel: ObservableObject { problemSubCategory: selectedSubcategory ?? "", customMetadata: metadata?.toString() ?? "") let headers = APIRequestV2.HeadersV2(additionalHeaders: [HTTPHeaderKey.authorization: "Bearer \(accessToken)"]) - let request = APIRequestV2(url: Self.feedbackEndpoint, method: .post, headers: headers, body: payload.toData()) + guard let request = APIRequestV2(url: Self.feedbackEndpoint, method: .post, headers: headers, body: payload.toData()) else { + assertionFailure("Invalid request") + return + } let response: Response = try await apiService.fetch(request: request).decodeBody() if let error = response.error, !error.isEmpty { diff --git a/DuckDuckGoTests/AdAttributionFetcherTests.swift b/DuckDuckGoTests/AdAttributionFetcherTests.swift index 28b9c94541..f4cafa7b6d 100644 --- a/DuckDuckGoTests/AdAttributionFetcherTests.swift +++ b/DuckDuckGoTests/AdAttributionFetcherTests.swift @@ -20,7 +20,8 @@ import XCTest @testable import DuckDuckGo -@testable import TestUtils +import PersistenceTestingUtils +import NetworkingTestingUtils final class AdAttributionFetcherTests: XCTestCase { diff --git a/DuckDuckGoTests/AutocompleteSuggestionsDataSourceTests.swift b/DuckDuckGoTests/AutocompleteSuggestionsDataSourceTests.swift index 29ea8e5636..3f80a37043 100644 --- a/DuckDuckGoTests/AutocompleteSuggestionsDataSourceTests.swift +++ b/DuckDuckGoTests/AutocompleteSuggestionsDataSourceTests.swift @@ -29,7 +29,7 @@ import History @testable import Core @testable import DuckDuckGo -@testable import TestUtils +@testable import PersistenceTestingUtils final class AutocompleteSuggestionsDataSourceTests: XCTestCase { diff --git a/DuckDuckGoTests/AutofillLoginListViewModelTests.swift b/DuckDuckGoTests/AutofillLoginListViewModelTests.swift index cdc7c8dabd..29c7d312fb 100644 --- a/DuckDuckGoTests/AutofillLoginListViewModelTests.swift +++ b/DuckDuckGoTests/AutofillLoginListViewModelTests.swift @@ -25,7 +25,7 @@ import Combine @testable import Core @testable import BrowserServicesKit @testable import Common -@testable import TestUtils +@testable import PersistenceTestingUtils class AutofillLoginListViewModelTests: XCTestCase { diff --git a/DuckDuckGoTests/AutofillVaultKeychainMigratorTests.swift b/DuckDuckGoTests/AutofillVaultKeychainMigratorTests.swift index 7d5083ad09..88b8089878 100644 --- a/DuckDuckGoTests/AutofillVaultKeychainMigratorTests.swift +++ b/DuckDuckGoTests/AutofillVaultKeychainMigratorTests.swift @@ -20,7 +20,7 @@ import XCTest @testable import Core import BrowserServicesKit -import TestUtils +import PersistenceTestingUtils final class AutofillVaultKeychainMigratorTests: XCTestCase { diff --git a/DuckDuckGoTests/BookmarkStateRepairTests.swift b/DuckDuckGoTests/BookmarkStateRepairTests.swift index 421f4a3f7a..3ae7ff9357 100644 --- a/DuckDuckGoTests/BookmarkStateRepairTests.swift +++ b/DuckDuckGoTests/BookmarkStateRepairTests.swift @@ -20,7 +20,7 @@ import XCTest import CoreData import Bookmarks -import TestUtils +import PersistenceTestingUtils @testable import Core @testable import DuckDuckGo diff --git a/DuckDuckGoTests/BookmarksDatabaseSetupTests.swift b/DuckDuckGoTests/BookmarksDatabaseSetupTests.swift index b7ef842a95..afe1524d75 100644 --- a/DuckDuckGoTests/BookmarksDatabaseSetupTests.swift +++ b/DuckDuckGoTests/BookmarksDatabaseSetupTests.swift @@ -25,7 +25,7 @@ import CoreData import Bookmarks @testable import DuckDuckGo @testable import Core -import TestUtils +import PersistenceTestingUtils class DummyCoreDataStoreMock: CoreDataStoring { diff --git a/DuckDuckGoTests/BookmarksStateValidationTests.swift b/DuckDuckGoTests/BookmarksStateValidationTests.swift index 75d3ff5365..21b8196842 100644 --- a/DuckDuckGoTests/BookmarksStateValidationTests.swift +++ b/DuckDuckGoTests/BookmarksStateValidationTests.swift @@ -20,7 +20,7 @@ import XCTest import CoreData import Bookmarks -import TestUtils +import PersistenceTestingUtils @testable import Core @testable import DuckDuckGo diff --git a/DuckDuckGoTests/BrokenSiteReportingTests.swift b/DuckDuckGoTests/BrokenSiteReportingTests.swift index 708c5d59d8..7029f0989f 100644 --- a/DuckDuckGoTests/BrokenSiteReportingTests.swift +++ b/DuckDuckGoTests/BrokenSiteReportingTests.swift @@ -25,7 +25,7 @@ import OHHTTPStubsSwift @testable import Core import PrivacyDashboard @testable import DuckDuckGo -import TestUtils +import PersistenceTestingUtils final class BrokenSiteReportingTests: XCTestCase { private let data = JsonTestDataLoader() diff --git a/DuckDuckGoTests/DailyPixelTests.swift b/DuckDuckGoTests/DailyPixelTests.swift index 61dd1849e6..56ea3cab0a 100644 --- a/DuckDuckGoTests/DailyPixelTests.swift +++ b/DuckDuckGoTests/DailyPixelTests.swift @@ -19,7 +19,7 @@ import XCTest import Networking -import TestUtils +import PersistenceTestingUtils import Persistence @testable import Core diff --git a/DuckDuckGoTests/FireButtonReferenceTests.swift b/DuckDuckGoTests/FireButtonReferenceTests.swift index 66d1c32688..1129fa41b5 100644 --- a/DuckDuckGoTests/FireButtonReferenceTests.swift +++ b/DuckDuckGoTests/FireButtonReferenceTests.swift @@ -21,7 +21,7 @@ import XCTest import os.log import WebKit @testable import Core -import TestUtils +import PersistenceTestingUtils final class FireButtonReferenceTests: XCTestCase { diff --git a/DuckDuckGoTests/PersistentPixelTests.swift b/DuckDuckGoTests/PersistentPixelTests.swift index 1112aa0afc..c0afd90fb4 100644 --- a/DuckDuckGoTests/PersistentPixelTests.swift +++ b/DuckDuckGoTests/PersistentPixelTests.swift @@ -21,7 +21,7 @@ import Foundation import XCTest import Networking import Persistence -import TestUtils +import PersistenceTestingUtils @testable import Core final class PersistentPixelTests: XCTestCase { diff --git a/DuckDuckGoTests/UsageSegmentationStorageTests.swift b/DuckDuckGoTests/UsageSegmentationStorageTests.swift index 5fd41ae6c8..a33f953d47 100644 --- a/DuckDuckGoTests/UsageSegmentationStorageTests.swift +++ b/DuckDuckGoTests/UsageSegmentationStorageTests.swift @@ -20,8 +20,8 @@ import Foundation import XCTest @testable import Core -@testable import TestUtils @testable import Persistence +import PersistenceTestingUtils final class UsageSegmentationStorageTests: XCTestCase { diff --git a/WebViewUnitTests/CookieStorageTests.swift b/WebViewUnitTests/CookieStorageTests.swift index 62d56e30aa..d0e04ebb63 100644 --- a/WebViewUnitTests/CookieStorageTests.swift +++ b/WebViewUnitTests/CookieStorageTests.swift @@ -21,7 +21,7 @@ import XCTest @testable import Core import WebKit import Persistence -import TestUtils +import PersistenceTestingUtils public class CookieStorageTests: XCTestCase { diff --git a/WebViewUnitTests/DataStoreIDManagerTests.swift b/WebViewUnitTests/DataStoreIDManagerTests.swift index ea32e99b48..f71422262a 100644 --- a/WebViewUnitTests/DataStoreIDManagerTests.swift +++ b/WebViewUnitTests/DataStoreIDManagerTests.swift @@ -22,7 +22,7 @@ import Foundation import XCTest @testable import Core import WebKit -import TestUtils +import PersistenceTestingUtils class DataStoreIDManagerTests: XCTestCase { diff --git a/WebViewUnitTests/WebCacheManagerTests.swift b/WebViewUnitTests/WebCacheManagerTests.swift index 6fa7be86c1..10c9018f18 100644 --- a/WebViewUnitTests/WebCacheManagerTests.swift +++ b/WebViewUnitTests/WebCacheManagerTests.swift @@ -20,7 +20,7 @@ import XCTest @testable import Core import WebKit -import TestUtils +import PersistenceTestingUtils extension HTTPCookie { From 2b89d1adeb8b7a2bb45fc9473fe2391a57e73db1 Mon Sep 17 00:00:00 2001 From: Federico Cappelli Date: Fri, 17 Jan 2025 12:22:24 +0000 Subject: [PATCH 2/3] Dependency tree improved --- Core/PixelEvent.swift | 5 +- DuckDuckGo.xcodeproj/project.pbxproj | 69 +++++++------------ .../xcshareddata/swiftpm/Package.resolved | 2 +- ...etworkProtectionPacketTunnelProvider.swift | 2 +- 4 files changed, 29 insertions(+), 49 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 408bd7523f..eb8bb21e80 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -22,7 +22,6 @@ import BrowserServicesKit import Bookmarks import Configuration import DDGSync -import NetworkProtection extension Pixel { @@ -416,7 +415,7 @@ extension Pixel { case networkProtectionTunnelFailureDetected case networkProtectionTunnelFailureRecovered - case networkProtectionLatency(quality: NetworkProtectionLatencyMonitor.ConnectionQuality) + case networkProtectionLatency(quality: String) case networkProtectionLatencyError case networkProtectionEnabledOnSearch @@ -1387,7 +1386,7 @@ extension Pixel.Event { case .networkProtectionConnectionTesterExtendedFailureRecovered: return "m_netp_connection_tester_extended_failure_recovered" case .networkProtectionTunnelFailureDetected: return "m_netp_ev_tunnel_failure" case .networkProtectionTunnelFailureRecovered: return "m_netp_ev_tunnel_failure_recovered" - case .networkProtectionLatency(let quality): return "m_netp_ev_\(quality.rawValue)_latency" + case .networkProtectionLatency(let quality): return "m_netp_ev_\(quality)_latency" case .networkProtectionLatencyError: return "m_netp_ev_latency_error_d" case .networkProtectionRekeyAttempt: return "m_netp_rekey_attempt" case .networkProtectionRekeyCompleted: return "m_netp_rekey_completed" diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 863377de6e..9a12393a7c 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -75,7 +75,6 @@ 1E4FAA6627D8DFC800ADC5B3 /* CompleteDownloadRowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E4FAA6527D8DFC800ADC5B3 /* CompleteDownloadRowViewModel.swift */; }; 1E53508F2C7C9A1F00818DAA /* DefaultSubscriptionManager+AccountManagerKeychainAccessDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E53508E2C7C9A1F00818DAA /* DefaultSubscriptionManager+AccountManagerKeychainAccessDelegate.swift */; }; 1E5918472CA422A7008ED2B3 /* Navigation in Frameworks */ = {isa = PBXBuildFile; productRef = 1E5918462CA422A7008ED2B3 /* Navigation */; }; - 1E60989B290009C700A508F9 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 1E7060BD28F88EE200E4CCDB /* Common */; }; 1E60989D290011E600A508F9 /* ContentBlocking in Frameworks */ = {isa = PBXBuildFile; productRef = 1E60989C290011E600A508F9 /* ContentBlocking */; }; 1E6098A1290011E600A508F9 /* UserScript in Frameworks */ = {isa = PBXBuildFile; productRef = 1E6098A0290011E600A508F9 /* UserScript */; }; 1E6A4D692984208800A371D3 /* LocaleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6A4D682984208800A371D3 /* LocaleExtension.swift */; }; @@ -272,7 +271,6 @@ 4BE67B012B96B741007335F7 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 4BE67B002B96B741007335F7 /* Common */; }; 4BE67B032B96B864007335F7 /* ContentBlocking in Frameworks */ = {isa = PBXBuildFile; productRef = 4BE67B022B96B864007335F7 /* ContentBlocking */; }; 4BE67B052B96B9AB007335F7 /* ContentBlocking in Frameworks */ = {isa = PBXBuildFile; productRef = 4BE67B042B96B9AB007335F7 /* ContentBlocking */; }; - 4BE67B072B96B9B0007335F7 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 4BE67B062B96B9B0007335F7 /* Common */; }; 4BF3E4AF2C06A85200ED5D57 /* VPNRedditSessionWorkaround.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3E4AE2C06A85200ED5D57 /* VPNRedditSessionWorkaround.swift */; }; 560E990F2BEE2CB800507CE0 /* SyncErrorMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 560E990E2BEE2CB800507CE0 /* SyncErrorMessage.swift */; }; 564DE4532C3ED1B700D23241 /* NewTabDaxDialogFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564DE4522C3ED1B700D23241 /* NewTabDaxDialogFactory.swift */; }; @@ -698,7 +696,6 @@ 98424AAE2CED4FF10071C7DB /* WebCacheManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 850559D123CF710C0055C0D5 /* WebCacheManagerTests.swift */; }; 98424AAF2CED4FF10071C7DB /* UserAgentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834DF990248FDDF60075EA48 /* UserAgentTests.swift */; }; 98424AB02CED4FF10071C7DB /* UserDefaultsFireproofingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8540BD5123D8C2220057FDD2 /* UserDefaultsFireproofingTests.swift */; }; - 98424AB22CEDD6150071C7DB /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = 98424AB12CEDD6150071C7DB /* BrowserServicesKit */; }; 98424AB42CEDD61C0071C7DB /* BrowserServicesKitTestsUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 98424AB32CEDD61C0071C7DB /* BrowserServicesKitTestsUtils */; }; 9847C00027A2DDBB00DB07AA /* AppPrivacyConfigurationDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9847BFFF27A2DDBB00DB07AA /* AppPrivacyConfigurationDataProvider.swift */; }; 9847C00527A41A0A00DB07AA /* WebViewTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9847C00327A419D500DB07AA /* WebViewTestHelper.swift */; }; @@ -1138,7 +1135,6 @@ EE7917912A83DE93008DFF28 /* CombineTestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE7917902A83DE93008DFF28 /* CombineTestUtilities.swift */; }; EE7A92872AC6DE4700832A36 /* NetworkProtectionNotificationIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE7A92862AC6DE4700832A36 /* NetworkProtectionNotificationIdentifier.swift */; }; EE8594992A44791C008A6D06 /* NetworkProtectionTunnelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE8594982A44791C008A6D06 /* NetworkProtectionTunnelController.swift */; }; - EE8E568A2A56BCE400F11DCA /* NetworkProtection in Frameworks */ = {isa = PBXBuildFile; productRef = EE8E56892A56BCE400F11DCA /* NetworkProtection */; }; EE9D68D12AE00CF300B55EF4 /* NetworkProtectionVPNSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE9D68D02AE00CF300B55EF4 /* NetworkProtectionVPNSettingsView.swift */; }; EE9D68D82AE15AD600B55EF4 /* UIApplicationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE9D68D72AE15AD600B55EF4 /* UIApplicationExtension.swift */; }; EE9D68DC2AE16AE100B55EF4 /* NotificationsAuthorizationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE9D68DB2AE16AE100B55EF4 /* NotificationsAuthorizationController.swift */; }; @@ -1182,7 +1178,6 @@ F143C3281E4A9A0E00CFDE3A /* StringExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F143C3241E4A9A0E00CFDE3A /* StringExtension.swift */; }; F143C3291E4A9A0E00CFDE3A /* URLExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F143C3251E4A9A0E00CFDE3A /* URLExtension.swift */; }; F14E491F1E391CE900DC037C /* URLExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F14E491E1E391CE900DC037C /* URLExtensionTests.swift */; }; - F15531902BF215ED0029ED04 /* Subscription in Frameworks */ = {isa = PBXBuildFile; productRef = F155318F2BF215ED0029ED04 /* Subscription */; }; F15531922BF215ED0029ED04 /* SubscriptionTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = F15531912BF215ED0029ED04 /* SubscriptionTestingUtilities */; }; F15531942BF215F60029ED04 /* Subscription in Frameworks */ = {isa = PBXBuildFile; productRef = F15531932BF215F60029ED04 /* Subscription */; }; F15531962BF215F60029ED04 /* SubscriptionTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = F15531952BF215F60029ED04 /* SubscriptionTestingUtilities */; }; @@ -1216,7 +1211,10 @@ F1B308612D3A752E00755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308602D3A752E00755104 /* BrowserServicesKit */; }; F1B308652D3A755400755104 /* PixelKitTestingUtilities in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308642D3A755400755104 /* PixelKitTestingUtilities */; }; F1B308692D3A75D500755104 /* SecureStorage in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308682D3A75D500755104 /* SecureStorage */; }; - F1B3086B2D3A762A00755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3086A2D3A762A00755104 /* BrowserServicesKit */; }; + F1B308702D3A785400755104 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3086F2D3A785400755104 /* BrowserServicesKit */; }; + F1B308772D3A7FBB00755104 /* NetworkProtection in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308762D3A7FBB00755104 /* NetworkProtection */; }; + F1B308792D3A7FDE00755104 /* NetworkProtection in Frameworks */ = {isa = PBXBuildFile; productRef = F1B308782D3A7FDE00755104 /* NetworkProtection */; }; + F1B3087B2D3A800700755104 /* NetworkProtection in Frameworks */ = {isa = PBXBuildFile; productRef = F1B3087A2D3A800700755104 /* NetworkProtection */; }; F1BDDBFD2C340D9C00459306 /* SubscriptionContainerViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBF92C340D9C00459306 /* SubscriptionContainerViewModelTests.swift */; }; F1BDDBFE2C340D9C00459306 /* SubscriptionFlowViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBFA2C340D9C00459306 /* SubscriptionFlowViewModelTests.swift */; }; F1BDDBFF2C340D9C00459306 /* SubscriptionPagesUseSubscriptionFeatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BDDBFB2C340D9C00459306 /* SubscriptionPagesUseSubscriptionFeatureTests.swift */; }; @@ -3247,6 +3245,7 @@ buildActionMask = 2147483647; files = ( F1B308592D3A729500755104 /* BrowserServicesKit in Frameworks */, + F1B308792D3A7FDE00755104 /* NetworkProtection in Frameworks */, 02025664298818B200E694E7 /* NetworkExtension.framework in Frameworks */, F1B308572D3A727F00755104 /* Persistence in Frameworks */, 4B45D85C2BE0B115006061B5 /* Subscription in Frameworks */, @@ -3284,6 +3283,7 @@ 7B2CCBA52D11ABBA00FE5852 /* VPNWidgetSupport in Frameworks */, F143C2EB1E4A4CD400CFDE3A /* Core.framework in Frameworks */, 31E69A63280F4CB600478327 /* DuckUI in Frameworks */, + F1B3087B2D3A800700755104 /* NetworkProtection in Frameworks */, CB941A6E2B96AB08000F9E7A /* PrivacyDashboard in Frameworks */, F42D541D29DCA40B004C4FF1 /* DesignResourcesKit in Frameworks */, 1E5918472CA422A7008ED2B3 /* Navigation in Frameworks */, @@ -3304,10 +3304,8 @@ 4BE67B052B96B9AB007335F7 /* ContentBlocking in Frameworks */, F1B308512D3A721B00755104 /* PersistenceTestingUtils in Frameworks */, F15531922BF215ED0029ED04 /* SubscriptionTestingUtilities in Frameworks */, - F15531902BF215ED0029ED04 /* Subscription in Frameworks */, + F1B308702D3A785400755104 /* BrowserServicesKit in Frameworks */, EEFAB4672A73C230008A38E4 /* NetworkProtectionTestUtils in Frameworks */, - F1B3086B2D3A762A00755104 /* BrowserServicesKit in Frameworks */, - 4BE67B072B96B9B0007335F7 /* Common in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3317,6 +3315,7 @@ files = ( 8512EA5124ED30D20073EE19 /* SwiftUI.framework in Frameworks */, 4BD96E062C4DBC93003BC32C /* NetworkExtension.framework in Frameworks */, + F1B308772D3A7FBB00755104 /* NetworkProtection in Frameworks */, F1B308532D3A725600755104 /* Persistence in Frameworks */, 85DF714624F7FE6100C89288 /* Core.framework in Frameworks */, 7B2CCBA32D11ABB100FE5852 /* VPNWidgetSupport in Frameworks */, @@ -3373,7 +3372,6 @@ 98424A962CED4F430071C7DB /* OHHTTPStubs in Frameworks */, 98424A972CED4F430071C7DB /* OHHTTPStubsSwift in Frameworks */, 98424A982CED4F430071C7DB /* ContentBlocking in Frameworks */, - 98424AB22CEDD6150071C7DB /* BrowserServicesKit in Frameworks */, F1B3084F2D3A721400755104 /* PersistenceTestingUtils in Frameworks */, 98424A992CED4F430071C7DB /* SubscriptionTestingUtilities in Frameworks */, 98424A9A2CED4F430071C7DB /* Subscription in Frameworks */, @@ -3409,11 +3407,9 @@ files = ( 4B948E2629DCCDB9002531FA /* Persistence in Frameworks */, 98A50962294B48A400D10880 /* Bookmarks in Frameworks */, - 1E60989B290009C700A508F9 /* Common in Frameworks */, 1E60989D290011E600A508F9 /* ContentBlocking in Frameworks */, CB6CC7E42CD2529000320907 /* BrokenSitePrompt in Frameworks */, F486D33425069BBB002D07D7 /* Kingfisher in Frameworks */, - EE8E568A2A56BCE400F11DCA /* NetworkProtection in Frameworks */, D6BC8ACB2C5AA3860025375B /* DuckPlayer in Frameworks */, CBC83E3429B631780008E19C /* Configuration in Frameworks */, D61CDA182B7CF78300A0FBB9 /* ZIPFoundation in Frameworks */, @@ -6978,6 +6974,7 @@ 4BC8948B2C7902E6009AA141 /* WireGuard */, F1B308562D3A727F00755104 /* Persistence */, F1B308582D3A729500755104 /* BrowserServicesKit */, + F1B308782D3A7FDE00755104 /* NetworkProtection */, ); productName = PacketTunnelProvider; productReference = 02025662298818B100E694E7 /* PacketTunnelProvider.appex */; @@ -7065,6 +7062,7 @@ 1E5918462CA422A7008ED2B3 /* Navigation */, 7B2CCBA42D11ABBA00FE5852 /* VPNWidgetSupport */, 315C77812CFA41A400699683 /* AIChat */, + F1B3087A2D3A800700755104 /* NetworkProtection */, ); productName = DuckDuckGo; productReference = 84E341921E2F7EFB00BDBA6F /* DuckDuckGo.app */; @@ -7089,12 +7087,10 @@ F486D3372506A225002D07D7 /* OHHTTPStubsSwift */, EEFAB4662A73C230008A38E4 /* NetworkProtectionTestUtils */, 4BE67B042B96B9AB007335F7 /* ContentBlocking */, - 4BE67B062B96B9B0007335F7 /* Common */, - F155318F2BF215ED0029ED04 /* Subscription */, F15531912BF215ED0029ED04 /* SubscriptionTestingUtilities */, F1B308502D3A721B00755104 /* PersistenceTestingUtils */, F1B308682D3A75D500755104 /* SecureStorage */, - F1B3086A2D3A762A00755104 /* BrowserServicesKit */, + F1B3086F2D3A785400755104 /* BrowserServicesKit */, ); productName = DuckDuckGoTests; productReference = 84E341A61E2F7EFB00BDBA6F /* UnitTests.xctest */; @@ -7118,6 +7114,7 @@ 4BBBBA862B02E85400D965DA /* DesignResourcesKit */, 7B2CCBA22D11ABB100FE5852 /* VPNWidgetSupport */, F1B308522D3A725600755104 /* Persistence */, + F1B308762D3A7FBB00755104 /* NetworkProtection */, ); productName = WidgetsExtension; productReference = 8512EA4D24ED30D20073EE19 /* WidgetsExtension.appex */; @@ -7231,7 +7228,6 @@ 984249C72CED4F430071C7DB /* Common */, 984249C82CED4F430071C7DB /* Subscription */, 984249C92CED4F430071C7DB /* SubscriptionTestingUtilities */, - 98424AB12CEDD6150071C7DB /* BrowserServicesKit */, 98424AB32CEDD61C0071C7DB /* BrowserServicesKitTestsUtils */, F1B3084E2D3A721400755104 /* PersistenceTestingUtils */, ); @@ -7308,7 +7304,6 @@ F486D33325069BBB002D07D7 /* Kingfisher */, C14882EC27F211A000D59F0C /* SwiftSoup */, 98A16C2C28A11D6200A6C003 /* BrowserServicesKit */, - 1E7060BD28F88EE200E4CCDB /* Common */, 1E60989C290011E600A508F9 /* ContentBlocking */, 1E6098A0290011E600A508F9 /* UserScript */, 98A50961294B48A400D10880 /* Bookmarks */, @@ -7317,7 +7312,6 @@ 4B948E2529DCCDB9002531FA /* Persistence */, 37DF000B29F9CA80002B7D3E /* SyncDataProviders */, 851481872A600EFC00ABC65F /* RemoteMessaging */, - EE8E56892A56BCE400F11DCA /* NetworkProtection */, D61CDA152B7CF77300A0FBB9 /* Subscription */, D61CDA172B7CF78300A0FBB9 /* ZIPFoundation */, 858D009C2B9799FC004E5B4C /* History */, @@ -12068,11 +12062,6 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = UserScript; }; - 1E7060BD28F88EE200E4CCDB /* Common */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = Common; - }; 315C77812CFA41A400699683 /* AIChat */ = { isa = XCSwiftPackageProductDependency; productName = AIChat; @@ -12125,11 +12114,6 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = ContentBlocking; }; - 4BE67B062B96B9B0007335F7 /* Common */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = Common; - }; 56D779392CFFC7E800B619EF /* PixelExperimentKit */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; @@ -12212,11 +12196,6 @@ package = 984249C42CED4F430071C7DB /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = SubscriptionTestingUtilities; }; - 98424AB12CEDD6150071C7DB /* BrowserServicesKit */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = BrowserServicesKit; - }; 98424AB32CEDD61C0071C7DB /* BrowserServicesKitTestsUtils */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; @@ -12299,21 +12278,11 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = DuckPlayer; }; - EE8E56892A56BCE400F11DCA /* NetworkProtection */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = NetworkProtection; - }; EEFAB4662A73C230008A38E4 /* NetworkProtectionTestUtils */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = NetworkProtectionTestUtils; }; - F155318F2BF215ED0029ED04 /* Subscription */ = { - isa = XCSwiftPackageProductDependency; - package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; - productName = Subscription; - }; F15531912BF215ED0029ED04 /* SubscriptionTestingUtilities */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; @@ -12373,10 +12342,22 @@ isa = XCSwiftPackageProductDependency; productName = SecureStorage; }; - F1B3086A2D3A762A00755104 /* BrowserServicesKit */ = { + F1B3086F2D3A785400755104 /* BrowserServicesKit */ = { isa = XCSwiftPackageProductDependency; productName = BrowserServicesKit; }; + F1B308762D3A7FBB00755104 /* NetworkProtection */ = { + isa = XCSwiftPackageProductDependency; + productName = NetworkProtection; + }; + F1B308782D3A7FDE00755104 /* NetworkProtection */ = { + isa = XCSwiftPackageProductDependency; + productName = NetworkProtection; + }; + F1B3087A2D3A800700755104 /* NetworkProtection */ = { + isa = XCSwiftPackageProductDependency; + productName = NetworkProtection; + }; F1D43AF92B99C1D300BAB743 /* BareBonesBrowserKit */ = { isa = XCSwiftPackageProductDependency; package = F1D43AF82B99C1D300BAB743 /* XCRemoteSwiftPackageReference "BareBonesBrowser" */; diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 01151c85ca..1cc1aab451 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -33,7 +33,7 @@ "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { "branch" : "fcappelli/authv2/networking_improvements", - "revision" : "a99cda2926f489f915a9d988f3a2c96612975f02" + "revision" : "7cc96cfe0e9697123573a2a20e51da3f606be28e" } }, { diff --git a/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift b/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift index 7f75a8b758..d2217a7dbb 100644 --- a/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift +++ b/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift @@ -136,7 +136,7 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider { case .quality(let quality): guard quality != .unknown else { return } DailyPixel.fireDailyAndCount( - pixel: .networkProtectionLatency(quality: quality), + pixel: .networkProtectionLatency(quality: quality.rawValue), pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes, includedParameters: [.appVersion, .atb] ) From 18ecf78da121e15141a2ed00e80f186555d27920 Mon Sep 17 00:00:00 2001 From: Federico Cappelli Date: Fri, 17 Jan 2025 16:19:02 +0000 Subject: [PATCH 3/3] BSK updated --- .../xcshareddata/swiftpm/Package.resolved | 10 +++++----- DuckDuckGo/AppLifecycle/AppStates/Launching.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 1cc1aab451..2a82abf92b 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -33,7 +33,7 @@ "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { "branch" : "fcappelli/authv2/networking_improvements", - "revision" : "7cc96cfe0e9697123573a2a20e51da3f606be28e" + "revision" : "a426daed5e348a0f0e179f010733edae5c74da6e" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "0502ed7de4130bd8705daebaca9aeb20d3e62d15", - "version" : "7.5.0" + "revision" : "7958ddab724c26326333cae13fe81478290607fa", + "version" : "7.6.0" } }, { @@ -203,8 +203,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/sync_crypto", "state" : { - "revision" : "0c8bf3c0e75591bc366407b9d7a73a9fcfc7736f", - "version" : "0.3.0" + "revision" : "cc726cebb67367466bc31ced4784e16d44ac68d1", + "version" : "0.4.0" } }, { diff --git a/DuckDuckGo/AppLifecycle/AppStates/Launching.swift b/DuckDuckGo/AppLifecycle/AppStates/Launching.swift index 36b008e8bd..e135c8745e 100644 --- a/DuckDuckGo/AppLifecycle/AppStates/Launching.swift +++ b/DuckDuckGo/AppLifecycle/AppStates/Launching.swift @@ -323,7 +323,7 @@ struct Launching: AppState { let url = URL.pixelUrl(forPixelNamed: pixelName) let apiHeaders = APIRequestV2.HeadersV2(additionalHeaders: headers) - guard let request = APIRequestV2(url: url, method: .get, queryItems: parameters, headers: apiHeaders) else { + guard let request = APIRequestV2(url: url, method: .get, queryItems: parameters.map({ item in (key: item.key, value: item.value) }), headers: apiHeaders) else { assertionFailure("Invalid request Pixel request") onComplete(false, nil) return