diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index c6874ad10a..e295b7b2a8 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -15024,31 +15024,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 208.0.0; - }; - }; - 9D84E4002CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git"; - requirement = { - kind = exactVersion; - version = 9.1.0; - }; - }; - 9D84E4032CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing"; - requirement = { - kind = exactVersion; - version = 1.15.4; - }; - }; - 9D84E4052CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; - requirement = { - kind = exactVersion; - version = 200.3.0; + version = 208.1.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { @@ -15650,22 +15626,18 @@ }; 9D84E3FF2CD4E66F0046CD8B /* OHHTTPStubs */ = { isa = XCSwiftPackageProductDependency; - package = 9D84E4002CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; productName = OHHTTPStubs; }; 9D84E4012CD4E66F0046CD8B /* OHHTTPStubsSwift */ = { isa = XCSwiftPackageProductDependency; - package = 9D84E4002CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; productName = OHHTTPStubsSwift; }; 9D84E4022CD4E66F0046CD8B /* SnapshotTesting */ = { isa = XCSwiftPackageProductDependency; - package = 9D84E4032CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; productName = SnapshotTesting; }; 9D84E4042CD4E66F0046CD8B /* PixelKitTestingUtilities */ = { isa = XCSwiftPackageProductDependency; - package = 9D84E4052CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = PixelKitTestingUtilities; }; 9D84E4062CD4E66F0046CD8B /* AppKitExtensions */ = { @@ -15674,7 +15646,6 @@ }; 9D84E4072CD4E66F0046CD8B /* Common */ = { isa = XCSwiftPackageProductDependency; - package = 9D84E4052CD4E66F0046CD8B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = Common; }; 9D9AE8F82AAA3AD00026E7DC /* DataBrokerProtection */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 1bc6693de4..1659b95a86 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" : "17154907fe86c75942331ed6d037694c666ddd95", - "version" : "208.0.0" + "revision" : "6be781530a2516c703b8e1bcf0c90e6e763d3300", + "version" : "208.1.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "1733ee59f06f6e725a98cf6cd8322159f59d664b", - "version" : "6.31.0" + "revision" : "adca39c379b1a124f9990e9d0308c374f32f5018", + "version" : "6.32.0" } }, { diff --git a/DuckDuckGo/Statistics/GeneralPixel.swift b/DuckDuckGo/Statistics/GeneralPixel.swift index 2f5a897199..095bc239c0 100644 --- a/DuckDuckGo/Statistics/GeneralPixel.swift +++ b/DuckDuckGo/Statistics/GeneralPixel.swift @@ -414,6 +414,8 @@ enum GeneralPixel: PixelKitEventV2 { case syncLoginExistingAccountError(error: Error) case syncCannotCreateRecoveryPDF case syncSecureStorageReadError(error: Error) + case syncSecureStorageDecodingError(error: Error) + case syncAccountRemoved(reason: String) case bookmarksCleanupFailed case bookmarksCleanupAttemptedWhileSyncWasEnabled @@ -1058,6 +1060,8 @@ enum GeneralPixel: PixelKitEventV2 { case .syncLoginExistingAccountError: return "sync_login_existing_account_error" case .syncCannotCreateRecoveryPDF: return "sync_cannot_create_recovery_pdf" case .syncSecureStorageReadError: return "sync_secure_storage_read_error" + case .syncSecureStorageDecodingError: return "sync_secure_storage_decoding_error" + case .syncAccountRemoved(let reason): return "sync_account_removed_reason_\(reason)" case .bookmarksCleanupFailed: return "bookmarks_cleanup_failed" case .bookmarksCleanupAttemptedWhileSyncWasEnabled: return "bookmarks_cleanup_attempted_while_sync_was_enabled" @@ -1119,6 +1123,7 @@ enum GeneralPixel: PixelKitEventV2 { .syncDeleteAccountError(let error), .syncLoginExistingAccountError(let error), .syncSecureStorageReadError(let error), + .syncSecureStorageDecodingError(let error), .bookmarksCouldNotLoadDatabase(let error?): return error default: return nil diff --git a/DuckDuckGo/Sync/SyncErrorHandler.swift b/DuckDuckGo/Sync/SyncErrorHandler.swift index beca1a0e2c..1f6c8f3522 100644 --- a/DuckDuckGo/Sync/SyncErrorHandler.swift +++ b/DuckDuckGo/Sync/SyncErrorHandler.swift @@ -88,18 +88,26 @@ public class SyncErrorHandler: EventMapping, ObservableObject { let alertPresenter: SyncAlertsPresenting - public init(alertPresenter: SyncAlertsPresenting = SyncAlertsPresenter()) { - self.alertPresenter = alertPresenter - super.init { event, _, _, _ in + static var errorHandlerMapping: Mapping { + return { event, _, _, _ in switch event { - case .failedToReadSecureStore(let status): + case .failedToReadSecureStore: PixelKit.fire(DebugEvent(GeneralPixel.syncSecureStorageReadError(error: event), error: event)) + case .failedToDecodeSecureStoreData(let error): + PixelKit.fire(DebugEvent(GeneralPixel.syncSecureStorageDecodingError(error: error), error: error)) + case .accountRemoved(let reason): + PixelKit.fire(DebugEvent(GeneralPixel.syncAccountRemoved(reason: reason.rawValue), error: event)) default: PixelKit.fire(DebugEvent(GeneralPixel.syncSentUnauthenticatedRequest, error: event)) } } } + public init(alertPresenter: SyncAlertsPresenting = SyncAlertsPresenter()) { + self.alertPresenter = alertPresenter + super.init(mapping: Self.errorHandlerMapping) + } + override init(mapping: @escaping EventMapping.Mapping) { fatalError("Use init()") } diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 1ca148fcbd..979cbc8746 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: "208.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "208.1.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../AppKitExtensions"), .package(path: "../XPCHelper"), diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 10a3daafbf..4177532a74 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "208.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "208.1.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 5674c884bc..fa22cbe544 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: "208.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "208.1.0"), .package(path: "../SwiftUIExtensions") ], targets: [