From 0f9d59642a294afb50c46340774b9f21faa15a7b Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Mon, 8 Apr 2024 10:54:59 +0200 Subject: [PATCH 1/2] VPN: Cleanup authorize call (#2685) Task/Issue URL: https://app.asana.com/0/0/1206999858530020/f macOS PR: https://github.com/duckduckgo/macos-browser/pull/2553 BSK PR: https://github.com/duckduckgo/BrowserServicesKit/pull/763 ## Description Removes unused code. --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 6e4aff14a0..52397206fc 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10037,7 +10037,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 132.0.1; + version = 132.0.2; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 58ea241b57..4a21ca3ba9 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" : "73f68ee1c0dda3cd4a0b0cc3cc38a6cc7e605829", - "version" : "132.0.1" + "revision" : "5199a6964e183c3d001b188286bbabeca93c8849", + "version" : "132.0.2" } }, { From 75ae662c8723f12a8273eb82b584c8cb6d7646d2 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Mon, 8 Apr 2024 11:00:22 +0200 Subject: [PATCH 2/2] Removed VPN waitlist beta pixels (#2686) Task/Issue URL: https://app.asana.com/0/0/1207008939337649/f macOS PR: https://github.com/duckduckgo/macos-browser/pull/2555 ## Description Removes all VPN waitlist beta pixels. --- Core/PixelEvent.swift | 18 --------- DuckDuckGo/AppDelegate+Waitlists.swift | 5 --- DuckDuckGo/AppDelegate.swift | 1 - .../NetworkProtectionAccessController.swift | 9 ----- ...listTermsAndConditionsViewController.swift | 4 -- DuckDuckGo/VPNWaitlistViewController.swift | 4 -- ...tworkProtectionAccessControllerTests.swift | 37 ------------------- 7 files changed, 78 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index ba826f3a0a..276a6deb85 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -345,15 +345,6 @@ extension Pixel { case networkProtectionUnhandledError - case networkProtectionWaitlistUserActive - case networkProtectionSettingsRowDisplayed - case networkProtectionWaitlistIntroScreenDisplayed - case networkProtectionWaitlistTermsDisplayed - case networkProtectionWaitlistTermsAccepted - case networkProtectionWaitlistNotificationShown - case networkProtectionWaitlistNotificationLaunched - case networkProtectionWaitlistRetriedInviteCodeRedemption - case networkProtectionGeoswitchingOpened case networkProtectionGeoswitchingSetNearest case networkProtectionGeoswitchingSetCustom @@ -929,15 +920,6 @@ extension Pixel.Event { case .networkProtectionMemoryCritical: return "m_netp_vpn_memory_critical" case .networkProtectionUnhandledError: return "m_netp_unhandled_error" - case .networkProtectionWaitlistUserActive: return "m_netp_waitlist_user_active" - case .networkProtectionSettingsRowDisplayed: return "m_netp_waitlist_settings_entry_viewed" - case .networkProtectionWaitlistIntroScreenDisplayed: return "m_netp_waitlist_intro_screen_viewed" - case .networkProtectionWaitlistTermsDisplayed: return "m_netp_waitlist_terms_viewed" - case .networkProtectionWaitlistTermsAccepted: return "m_netp_waitlist_terms_accepted" - case .networkProtectionWaitlistNotificationShown: return "m_netp_waitlist_notification_shown" - case .networkProtectionWaitlistNotificationLaunched: return "m_netp_waitlist_notification_launched" - case .networkProtectionWaitlistRetriedInviteCodeRedemption: return "m_netp_waitlist_retried_invite_code_redemption" - case .networkProtectionGeoswitchingOpened: return "m_netp_imp_geoswitching" case .networkProtectionGeoswitchingSetNearest: return "m_netp_ev_geoswitching_set_nearest" case .networkProtectionGeoswitchingSetCustom: return "m_netp_ev_geoswitching_set_custom" diff --git a/DuckDuckGo/AppDelegate+Waitlists.swift b/DuckDuckGo/AppDelegate+Waitlists.swift index 361c2e2ec3..967b830348 100644 --- a/DuckDuckGo/AppDelegate+Waitlists.swift +++ b/DuckDuckGo/AppDelegate+Waitlists.swift @@ -46,9 +46,6 @@ extension AppDelegate { #if NETWORK_PROTECTION private func checkNetworkProtectionWaitlist() { let accessController = NetworkProtectionAccessController() - if accessController.isPotentialOrCurrentWaitlistUser { - DailyPixel.fire(pixel: .networkProtectionWaitlistUserActive) - } VPNWaitlist.shared.fetchInviteCodeIfAvailable { [weak self] error in guard error == nil else { @@ -70,8 +67,6 @@ extension AppDelegate { do { try await NetworkProtectionCodeRedemptionCoordinator().redeem(inviteCode) VPNWaitlist.shared.sendInviteCodeAvailableNotification() - - DailyPixel.fireDailyAndCount(pixel: .networkProtectionWaitlistNotificationShown) } catch {} } } diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index bb9690c51e..1bf54d8d4b 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -1010,7 +1010,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate { if vpnFeatureVisibility.shouldKeepVPNAccessViaWaitlist(), identifier == VPNWaitlist.notificationIdentifier { presentNetworkProtectionWaitlistModal() - DailyPixel.fire(pixel: .networkProtectionWaitlistNotificationLaunched) } #endif diff --git a/DuckDuckGo/NetworkProtectionAccessController.swift b/DuckDuckGo/NetworkProtectionAccessController.swift index a1acf99f11..aa683bf228 100644 --- a/DuckDuckGo/NetworkProtectionAccessController.swift +++ b/DuckDuckGo/NetworkProtectionAccessController.swift @@ -70,15 +70,6 @@ struct NetworkProtectionAccessController: NetworkProtectionAccess { return (regionCode ?? "US") == "US" } - var isPotentialOrCurrentWaitlistUser: Bool { - switch self.networkProtectionAccessType() { - case .none, .inviteCodeInvited: - return false - case .waitlistAvailable, .waitlistJoined, .waitlistInvitedPendingTermsAcceptance, .waitlistInvited: - return true - } - } - init( networkProtectionActivation: NetworkProtectionFeatureActivation = NetworkProtectionKeychainTokenStore(), networkProtectionWaitlistStorage: WaitlistStorage = WaitlistKeychainStore(waitlistIdentifier: VPNWaitlist.identifier), diff --git a/DuckDuckGo/VPNWaitlistTermsAndConditionsViewController.swift b/DuckDuckGo/VPNWaitlistTermsAndConditionsViewController.swift index a5186e7891..29aba0356e 100644 --- a/DuckDuckGo/VPNWaitlistTermsAndConditionsViewController.swift +++ b/DuckDuckGo/VPNWaitlistTermsAndConditionsViewController.swift @@ -40,8 +40,6 @@ final class VPNWaitlistTermsAndConditionsViewController: UIViewController { title = UserText.netPNavTitle addHostingControllerToViewHierarchy() - - DailyPixel.fire(pixel: .networkProtectionWaitlistTermsDisplayed) } private func addHostingControllerToViewHierarchy() { @@ -49,8 +47,6 @@ final class VPNWaitlistTermsAndConditionsViewController: UIViewController { var termsAndConditionsStore = NetworkProtectionTermsAndConditionsUserDefaultsStore() termsAndConditionsStore.networkProtectionWaitlistTermsAndConditionsAccepted = true - DailyPixel.fire(pixel: .networkProtectionWaitlistTermsAccepted) - self.navigationController?.popToRootViewController(animated: true) let networkProtectionViewController = NetworkProtectionRootViewController() self.navigationController?.pushViewController(networkProtectionViewController, animated: true) diff --git a/DuckDuckGo/VPNWaitlistViewController.swift b/DuckDuckGo/VPNWaitlistViewController.swift index 6de26a834b..c1b6c3aa87 100644 --- a/DuckDuckGo/VPNWaitlistViewController.swift +++ b/DuckDuckGo/VPNWaitlistViewController.swift @@ -68,10 +68,6 @@ final class VPNWaitlistViewController: UIViewController { private func updateViewState() { Task { await self.viewModel.updateViewState() - - if self.viewModel.viewState == .notJoinedQueue { - DailyPixel.fire(pixel: .networkProtectionWaitlistIntroScreenDisplayed) - } } } diff --git a/DuckDuckGoTests/NetworkProtectionAccessControllerTests.swift b/DuckDuckGoTests/NetworkProtectionAccessControllerTests.swift index 7817e1cc1d..d3fc9e8294 100644 --- a/DuckDuckGoTests/NetworkProtectionAccessControllerTests.swift +++ b/DuckDuckGoTests/NetworkProtectionAccessControllerTests.swift @@ -117,43 +117,6 @@ final class NetworkProtectionAccessControllerTests: XCTestCase { XCTAssertEqual(controller.networkProtectionAccessType(), .waitlistInvited) } - func testWhenUserHasWaitlistAccess_ThenWaitlistUserCheckIsTrue() { - let controller = createMockAccessController( - isInternalUser: true, - featureActivated: true, - termsAccepted: true, - featureFlagsEnabled: true, - hasJoinedWaitlist: true, - hasBeenInvited: true - ) - - XCTAssertTrue(controller.isPotentialOrCurrentWaitlistUser) - } - - func testWhenUserDoesNotHaveWaitlistAccess_ThenWaitlistUserCheckIsFalse() { - let controller = createMockAccessController( - featureActivated: false, - termsAccepted: false, - featureFlagsEnabled: false, - hasJoinedWaitlist: false, - hasBeenInvited: false - ) - - XCTAssertFalse(controller.isPotentialOrCurrentWaitlistUser) - } - - func testWhenUserIsInternal_ThenWaitlistUserCheckIsFalse() { - let controller = createMockAccessController( - featureActivated: true, - termsAccepted: false, - featureFlagsEnabled: false, - hasJoinedWaitlist: false, - hasBeenInvited: false - ) - - XCTAssertFalse(controller.isPotentialOrCurrentWaitlistUser) - } - // MARK: - Mock Creation private func createMockAccessController(