diff --git a/Core/BookmarksModelsErrorHandling.swift b/Core/BookmarksModelsErrorHandling.swift index 5d25ef7c80..b60ecdd4d8 100644 --- a/Core/BookmarksModelsErrorHandling.swift +++ b/Core/BookmarksModelsErrorHandling.swift @@ -57,10 +57,6 @@ public class BookmarksModelsErrorHandling: EventMapping { case .missingParent(let object): domainEvent = .missingParent(object) - case .orphanedBookmarksPresent: - if let syncService, syncService.authState == .inactive { - domainEvent = .orphanedBookmarksPresent - } } if let domainEvent { diff --git a/Core/DailyPixel.swift b/Core/DailyPixel.swift index eb583ee6af..af326479de 100644 --- a/Core/DailyPixel.swift +++ b/Core/DailyPixel.swift @@ -51,10 +51,14 @@ public final class DailyPixel { /// Does not append any suffix unlike the alternative function below public static func fire(pixel: Pixel.Event, withAdditionalParameters params: [String: String] = [:], + includedParameters: [Pixel.QueryParameters] = [.atb, .appVersion], onComplete: @escaping (Swift.Error?) -> Void = { _ in }) { if !pixel.hasBeenFiredToday(dailyPixelStorage: storage) { - Pixel.fire(pixel: pixel, withAdditionalParameters: params, onComplete: onComplete) + Pixel.fire(pixel: pixel, + withAdditionalParameters: params, + includedParameters: includedParameters, + onComplete: onComplete) updatePixelLastFireDate(pixel: pixel) } else { onComplete(Error.alreadyFired) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index a9c8def9f4..8d1ac89d99 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -505,7 +505,6 @@ extension Pixel { case indexOutOfRange(BookmarksModelError.ModelType) case saveFailed(BookmarksModelError.ModelType) case missingParent(BookmarksModelError.ObjectType) - case orphanedBookmarksPresent case bookmarksCouldNotLoadDatabase case bookmarksCouldNotPrepareDatabase @@ -1036,7 +1035,6 @@ extension Pixel.Event { case .indexOutOfRange(let modelType): return "m_d_bookmarks_index_out_of_range_\(modelType.rawValue)" case .saveFailed(let modelType): return "m_d_bookmarks_view_model_save_failed_\(modelType.rawValue)" case .missingParent(let objectType): return "m_d_bookmark_model_missing_parent_\(objectType.rawValue)" - case .orphanedBookmarksPresent: return "m_d_bookmarks_orphans_present" case .bookmarksCouldNotLoadDatabase: return "m_d_bookmarks_could_not_load_database" case .bookmarksCouldNotPrepareDatabase: return "m_d_bookmarks_could_not_prepare_database" diff --git a/Core/SyncMetricsEventsHandler.swift b/Core/SyncMetricsEventsHandler.swift index 4b288c4478..a9fb6f2a10 100644 --- a/Core/SyncMetricsEventsHandler.swift +++ b/Core/SyncMetricsEventsHandler.swift @@ -27,9 +27,9 @@ public class SyncMetricsEventsHandler: EventMapping { super.init { event, _, _, _ in switch event { case .overrideEmailProtectionSettings: - Pixel.fire(pixel: .syncDuckAddressOverride) + Pixel.fire(pixel: .syncDuckAddressOverride, includedParameters: [.appVersion]) case .localTimestampResolutionTriggered(let feature): - Pixel.fire(pixel: .syncLocalTimestampResolutionTriggered(feature)) + Pixel.fire(pixel: .syncLocalTimestampResolutionTriggered(feature), includedParameters: [.appVersion]) } } } diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 1b4eebbf57..67b2d9fd47 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -9221,7 +9221,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 95.0.0; + version = 96.0.0; }; }; C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4c2e238aea..ec9031e07b 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "ae9e9180f74d92c83fc3cc1d2fc23f4855fb361c", - "version" : "95.0.0" + "revision" : "e5c9e31b19b3cf78e2b704a60882ba24b9bc680d", + "version" : "96.0.0" } }, { diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index a7b87702f1..4aed576445 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -289,9 +289,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { isSyncInProgressCancellable = syncService.isSyncInProgressPublisher .filter { $0 } - .prefix(1) - .sink { _ in - DailyPixel.fire(pixel: .syncDaily) + .sink { [weak syncService] _ in + DailyPixel.fire(pixel: .syncDaily, includedParameters: [.appVersion]) + syncService?.syncDailyStats.sendStatsIfNeeded(handler: { params in + Pixel.fire(pixel: .syncSuccessRateDaily, + withAdditionalParameters: params, + includedParameters: [.appVersion]) + }) } #if APP_TRACKING_PROTECTION diff --git a/DuckDuckGo/SyncSettingsViewController+SyncDelegate.swift b/DuckDuckGo/SyncSettingsViewController+SyncDelegate.swift index e2ec2ae698..d525348690 100644 --- a/DuckDuckGo/SyncSettingsViewController+SyncDelegate.swift +++ b/DuckDuckGo/SyncSettingsViewController+SyncDelegate.swift @@ -56,7 +56,7 @@ extension SyncSettingsViewController: SyncManagementViewModelDelegate { self.dismissPresentedViewController() self.showPreparingSync() try await syncService.createAccount(deviceName: deviceName, deviceType: deviceType) - Pixel.fire(pixel: .syncSignupDirect) + Pixel.fire(pixel: .syncSignupDirect, includedParameters: [.appVersion]) self.rootView.model.syncEnabled(recoveryCode: recoveryCode) self.refreshDevices() navigationController?.topViewController?.dismiss(animated: true, completion: showRecoveryPDF) diff --git a/DuckDuckGo/SyncSettingsViewController.swift b/DuckDuckGo/SyncSettingsViewController.swift index 059b28fd26..84d4847ca8 100644 --- a/DuckDuckGo/SyncSettingsViewController.swift +++ b/DuckDuckGo/SyncSettingsViewController.swift @@ -242,7 +242,7 @@ extension SyncSettingsViewController: ScanOrPasteCodeViewModelDelegate { func loginAndShowDeviceConnected(recoveryKey: SyncCode.RecoveryKey) async throws { let registeredDevices = try await syncService.login(recoveryKey, deviceName: deviceName, deviceType: deviceType) mapDevices(registeredDevices) - Pixel.fire(pixel: .syncLogin) + Pixel.fire(pixel: .syncLogin, includedParameters: [.appVersion]) DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.dismissVCAndShowRecoveryPDF() } @@ -281,7 +281,7 @@ extension SyncSettingsViewController: ScanOrPasteCodeViewModelDelegate { showPreparingSync() if syncService.account == nil { try await syncService.createAccount(deviceName: deviceName, deviceType: deviceType) - Pixel.fire(pixel: .syncSignupConnect) + Pixel.fire(pixel: .syncSignupConnect, includedParameters: [.appVersion]) self.dismissVCAndShowRecoveryPDF() shouldShowSyncEnabled = false rootView.model.syncEnabled(recoveryCode: recoveryCode) diff --git a/LocalPackages/DuckUI/Package.swift b/LocalPackages/DuckUI/Package.swift index 39e081690e..dabaf45967 100644 --- a/LocalPackages/DuckUI/Package.swift +++ b/LocalPackages/DuckUI/Package.swift @@ -31,7 +31,7 @@ let package = Package( targets: ["DuckUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "96.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 0ee341c76b..935d250501 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -32,7 +32,7 @@ let package = Package( ], dependencies: [ .package(path: "../DuckUI"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "96.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [ diff --git a/LocalPackages/Waitlist/Package.swift b/LocalPackages/Waitlist/Package.swift index 67ad170aa3..3db6f90251 100644 --- a/LocalPackages/Waitlist/Package.swift +++ b/LocalPackages/Waitlist/Package.swift @@ -15,7 +15,7 @@ let package = Package( targets: ["Waitlist", "WaitlistMocks"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "96.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [