Skip to content

Commit

Permalink
Removed VPN waitlist beta pixels (#2686)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1207008939337649/f

macOS PR: duckduckgo/macos-browser#2555

## Description

Removes all VPN waitlist beta pixels.
  • Loading branch information
diegoreymendez authored Apr 8, 2024
1 parent 0f9d596 commit 75ae662
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 78 deletions.
18 changes: 0 additions & 18 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions DuckDuckGo/AppDelegate+Waitlists.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -70,8 +67,6 @@ extension AppDelegate {
do {
try await NetworkProtectionCodeRedemptionCoordinator().redeem(inviteCode)
VPNWaitlist.shared.sendInviteCodeAvailableNotification()

DailyPixel.fireDailyAndCount(pixel: .networkProtectionWaitlistNotificationShown)
} catch {}
}
}
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate {

if vpnFeatureVisibility.shouldKeepVPNAccessViaWaitlist(), identifier == VPNWaitlist.notificationIdentifier {
presentNetworkProtectionWaitlistModal()
DailyPixel.fire(pixel: .networkProtectionWaitlistNotificationLaunched)
}

#endif
Expand Down
9 changes: 0 additions & 9 deletions DuckDuckGo/NetworkProtectionAccessController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 0 additions & 4 deletions DuckDuckGo/VPNWaitlistTermsAndConditionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ final class VPNWaitlistTermsAndConditionsViewController: UIViewController {

title = UserText.netPNavTitle
addHostingControllerToViewHierarchy()

DailyPixel.fire(pixel: .networkProtectionWaitlistTermsDisplayed)
}

private func addHostingControllerToViewHierarchy() {
let waitlistView = VPNWaitlistPrivacyPolicyView { _ in
var termsAndConditionsStore = NetworkProtectionTermsAndConditionsUserDefaultsStore()
termsAndConditionsStore.networkProtectionWaitlistTermsAndConditionsAccepted = true

DailyPixel.fire(pixel: .networkProtectionWaitlistTermsAccepted)

self.navigationController?.popToRootViewController(animated: true)
let networkProtectionViewController = NetworkProtectionRootViewController()
self.navigationController?.pushViewController(networkProtectionViewController, animated: true)
Expand Down
4 changes: 0 additions & 4 deletions DuckDuckGo/VPNWaitlistViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down
37 changes: 0 additions & 37 deletions DuckDuckGoTests/NetworkProtectionAccessControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 75ae662

Please sign in to comment.