From d71c725201ae0ca5c1b539c52c70667a04ddc0c6 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Mon, 4 Nov 2024 18:44:26 -0800 Subject: [PATCH 1/2] Update pixel type. --- DuckDuckGo.xcodeproj/project.pbxproj | 4 +- .../DataBrokerProtectionPixelsHandler.swift | 6 +- DuckDuckGo/LoginItems/LoginItemsManager.swift | 2 +- .../EventMapping+NetworkProtectionError.swift | 4 +- .../NetworkProtectionTunnelController.swift | 8 +- .../VPNLocation/VPNLocationViewModel.swift | 6 +- ...NetworkProtectionIPCTunnelController.swift | 8 +- .../MacPacketTunnelProvider.swift | 66 ++++++------- .../View/PreferencesRootView.swift | 4 +- .../Preferences/View/PreferencesVPNView.swift | 6 +- .../SmarterEncryption/PrivacyFeatures.swift | 4 +- ...riptionManager+StandardConfiguration.swift | 2 +- DuckDuckGo/Sync/SyncDiagnosisHelper.swift | 2 +- ...workProtectionControllerTabExtension.swift | 2 +- .../SubscriptionAppStoreRestorer.swift | 6 +- .../SubscriptionErrorReporter.swift | 8 +- ...scriptionPagesUseSubscriptionFeature.swift | 14 +-- .../UnifiedFeedbackSender.swift | 6 +- DuckDuckGo/Waitlist/VPNUninstaller.swift | 8 +- DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift | 2 +- DuckDuckGoVPN/VPNUninstaller.swift | 10 +- .../Pixels/DataBrokerProtectionPixels.swift | 6 +- ...ansparentProxyControllerEventHandler.swift | 2 +- ...TransparentProxyProviderEventHandler.swift | 2 +- .../NetworkProtectionPixelEventTests.swift | 94 +++++++++---------- 25 files changed, 141 insertions(+), 141 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 731efbd4e7..12b86cd672 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -14833,8 +14833,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BareBonesBrowser.git"; requirement = { - kind = exactVersion; - version = 0.1.0; + branch = "sam/migrate-daily-and-count-type-to-legacy-status"; + kind = branch; }; }; FAE06B199CA1F209B55B34E9 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */ = { diff --git a/DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift b/DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift index cc4c928d89..223a57ee63 100644 --- a/DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift +++ b/DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift @@ -40,7 +40,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping Encodable? { - PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseEmailSuccess, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseEmailSuccess, frequency: .legacyDailyAndCount) guard let subscriptionValues: SubscriptionValues = DecodableHelper.decode(from: params) else { assertionFailure("SubscriptionPagesUserScript: expected JSON representation of SubscriptionValues") @@ -189,7 +189,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { } func subscriptionSelected(params: Any, original: WKScriptMessage) async throws -> Encodable? { - PixelKit.fire(PrivacyProPixel.privacyProPurchaseAttempt, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProPurchaseAttempt, frequency: .legacyDailyAndCount) struct SubscriptionSelection: Decodable { let id: String } @@ -273,7 +273,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { switch completePurchaseResult { case .success(let purchaseUpdate): Logger.subscription.info("[Purchase] Purchase complete") - PixelKit.fire(PrivacyProPixel.privacyProPurchaseSuccess, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProPurchaseSuccess, frequency: .legacyDailyAndCount) sendFreemiumSubscriptionPixelIfFreemiumActivated() saveSubscriptionUpgradeTimestampIfFreemiumActivated() PixelKit.fire(PrivacyProPixel.privacyProSubscriptionActivated, frequency: .unique) @@ -385,7 +385,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { await stripePurchaseFlow.completeSubscriptionPurchase() await uiHandler.dismissProgressViewController() - PixelKit.fire(PrivacyProPixel.privacyProPurchaseStripeSuccess, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProPurchaseStripeSuccess, frequency: .legacyDailyAndCount) sendFreemiumSubscriptionPixelIfFreemiumActivated() saveSubscriptionUpgradeTimestampIfFreemiumActivated() subscriptionSuccessPixelHandler.fireSuccessfulSubscriptionAttributionPixel() @@ -457,7 +457,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { // MARK: - UI interactions func showSomethingWentWrongAlert() async { - PixelKit.fire(PrivacyProPixel.privacyProPurchaseFailure, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProPurchaseFailure, frequency: .legacyDailyAndCount) switch await uiHandler.dismissProgressViewAndShow(alertType: .somethingWentWrong, text: nil) { case .alertFirstButtonReturn: let url = subscriptionManager.url(for: .purchase) @@ -478,7 +478,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { authEndpointService: subscriptionManager.authEndpointService) let result = await appStoreRestoreFlow.restoreAccountFromPastPurchase() switch result { - case .success: PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseStoreSuccess, frequency: .dailyAndCount) + case .success: PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseStoreSuccess, frequency: .legacyDailyAndCount) case .failure: break } Task { @MainActor in @@ -529,7 +529,7 @@ extension SubscriptionPagesUseSubscriptionFeature: SubscriptionAccessActionHandl func subscriptionAccessActionHandleAction(event: SubscriptionAccessActionHandlingEvent) { switch event { case .activateAddEmailClick: - PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseEmailStart, frequency: .dailyAndCount) + PixelKit.fire(PrivacyProPixel.privacyProRestorePurchaseEmailStart, frequency: .legacyDailyAndCount) default: break } } diff --git a/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift b/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift index 79f86b8f68..98ba6100bc 100644 --- a/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift +++ b/DuckDuckGo/UnifiedFeedbackForm/UnifiedFeedbackSender.swift @@ -111,7 +111,7 @@ struct DefaultFeedbackSender: UnifiedFeedbackSender { } func sendFormShowPixel() { - PixelKit.fire(GeneralPixel.pproFeedbackFormShow, frequency: .dailyAndCount) + PixelKit.fire(GeneralPixel.pproFeedbackFormShow, frequency: .legacyDailyAndCount) } func sendSubmitScreenShowPixel(source: UnifiedFeedbackSource, reportType: String, category: String, subcategory: String) { @@ -119,7 +119,7 @@ struct DefaultFeedbackSender: UnifiedFeedbackSender { reportType: ReportType.from(reportType), category: Category.from(category), subcategory: Subcategory.from(subcategory)), - frequency: .dailyAndCount) + frequency: .legacyDailyAndCount) } func sendSubmitScreenFAQClickPixel(source: UnifiedFeedbackSource, reportType: String, category: String, subcategory: String) { @@ -127,6 +127,6 @@ struct DefaultFeedbackSender: UnifiedFeedbackSender { reportType: ReportType.from(reportType), category: Category.from(category), subcategory: Subcategory.from(subcategory)), - frequency: .dailyAndCount) + frequency: .legacyDailyAndCount) } } diff --git a/DuckDuckGo/Waitlist/VPNUninstaller.swift b/DuckDuckGo/Waitlist/VPNUninstaller.swift index d164cf21b3..084f31e106 100644 --- a/DuckDuckGo/Waitlist/VPNUninstaller.swift +++ b/DuckDuckGo/Waitlist/VPNUninstaller.swift @@ -176,15 +176,15 @@ final class VPNUninstaller: VPNUninstalling { return } - pixelKit?.fire(IPCUninstallAttempt.begin, frequency: .dailyAndCount) + pixelKit?.fire(IPCUninstallAttempt.begin, frequency: .legacyDailyAndCount) do { try await executeUninstallSequence(removeSystemExtension: removeSystemExtension) - pixelKit?.fire(IPCUninstallAttempt.success, frequency: .dailyAndCount) + pixelKit?.fire(IPCUninstallAttempt.success, frequency: .legacyDailyAndCount) } catch UninstallError.cancelled(let reason) { - pixelKit?.fire(IPCUninstallAttempt.cancelled(reason), frequency: .dailyAndCount) + pixelKit?.fire(IPCUninstallAttempt.cancelled(reason), frequency: .legacyDailyAndCount) } catch { - pixelKit?.fire(IPCUninstallAttempt.failure(error), frequency: .dailyAndCount) + pixelKit?.fire(IPCUninstallAttempt.failure(error), frequency: .legacyDailyAndCount) } } diff --git a/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift b/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift index 40ecf9650b..b183d84e51 100644 --- a/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift +++ b/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift @@ -468,6 +468,6 @@ extension DuckDuckGoVPNAppDelegate: AccountManagerKeychainAccessDelegate { public func accountManagerKeychainAccessFailed(accessType: AccountKeychainAccessType, error: AccountKeychainAccessError) { PixelKit.fire(PrivacyProErrorPixel.privacyProKeychainAccessError(accessType: accessType, accessError: error), - frequency: .dailyAndCount) + frequency: .legacyDailyAndCount) } } diff --git a/DuckDuckGoVPN/VPNUninstaller.swift b/DuckDuckGoVPN/VPNUninstaller.swift index 1ae6a706cb..b6efdda308 100644 --- a/DuckDuckGoVPN/VPNUninstaller.swift +++ b/DuckDuckGoVPN/VPNUninstaller.swift @@ -48,7 +48,7 @@ final class VPNUninstaller: VPNUninstalling { } func uninstall(includingSystemExtension: Bool) async throws { - pixelKit?.fire(VPNUninstallAttempt.begin, frequency: .dailyAndCount) + pixelKit?.fire(VPNUninstallAttempt.begin, frequency: .legacyDailyAndCount) do { try await removeSystemExtension() @@ -59,15 +59,15 @@ final class VPNUninstaller: VPNUninstalling { } defaults.networkProtectionShouldShowVPNUninstalledMessage = true - pixelKit?.fire(VPNUninstallAttempt.success, frequency: .dailyAndCount) + pixelKit?.fire(VPNUninstallAttempt.success, frequency: .legacyDailyAndCount) } catch { switch error { case OSSystemExtensionError.requestCanceled: - pixelKit?.fire(VPNUninstallAttempt.cancelled(.sysexInstallationCancelled), frequency: .dailyAndCount) + pixelKit?.fire(VPNUninstallAttempt.cancelled(.sysexInstallationCancelled), frequency: .legacyDailyAndCount) case OSSystemExtensionError.authorizationRequired: - pixelKit?.fire(VPNUninstallAttempt.cancelled(.sysexInstallationRequiresAuthorization), frequency: .dailyAndCount) + pixelKit?.fire(VPNUninstallAttempt.cancelled(.sysexInstallationRequiresAuthorization), frequency: .legacyDailyAndCount) default: - pixelKit?.fire(VPNUninstallAttempt.failure(error), frequency: .dailyAndCount) + pixelKit?.fire(VPNUninstallAttempt.failure(error), frequency: .legacyDailyAndCount) } throw error diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Pixels/DataBrokerProtectionPixels.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Pixels/DataBrokerProtectionPixels.swift index f5fdcd9ce4..44f111e928 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Pixels/DataBrokerProtectionPixels.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Pixels/DataBrokerProtectionPixels.swift @@ -550,7 +550,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping Date: Mon, 4 Nov 2024 18:48:06 -0800 Subject: [PATCH 2/2] Fix BSK reference. --- DuckDuckGo.xcodeproj/project.pbxproj | 8 ++++---- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 12b86cd672..41d8257ac4 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -14777,8 +14777,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 203.1.0; + branch = "sam/migrate-daily-and-count-type-to-legacy-status"; + kind = branch; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { @@ -14833,8 +14833,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BareBonesBrowser.git"; requirement = { - branch = "sam/migrate-daily-and-count-type-to-legacy-status"; - kind = branch; + kind = exactVersion; + version = 0.1.0; }; }; FAE06B199CA1F209B55B34E9 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6c7c3d5617..153c80b9eb 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" : "19f1e5c945aa92562ad2d087e8d6c99801edf656", - "version" : "203.1.0" + "branch" : "sam/migrate-daily-and-count-type-to-legacy-status", + "revision" : "1915671f92f95f7e06870852787d96da9809a93c" } }, {