Skip to content

Commit

Permalink
Merge branch 'main' into sam/remove-apptp
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Apr 8, 2024
2 parents 4f762da + 75ae662 commit c854d06
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 81 deletions.
18 changes: 0 additions & 18 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,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 @@ -881,15 +872,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
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9426,7 +9426,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 132.0.1;
version = 132.0.2;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
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 @@ -950,7 +950,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 c854d06

Please sign in to comment.