-
Notifications
You must be signed in to change notification settings - Fork 16
Implement waitlistBetaActive logic (without actually resetting) #1562
Implement waitlistBetaActive logic (without actually resetting) #1562
Conversation
...etworkProtection/AppAndExtensionAndAgentTargets/UserDefaults+NetworkProtectionWaitlist.swift
Outdated
Show resolved
Hide resolved
| protocol WaitlistBetaOverriding { | ||
| var waitlistActive: WaitlistOverride { get } | ||
| var waitlistEnabled: WaitlistOverride { get } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protocol for obtaining the overrides in a way that we can mock this easily for testing.
|
|
||
| // MARK: - UI Additions | ||
|
|
||
| private func waitlistOFFAlert() -> NSAlert { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overriding the subfeatures to OFF will be "dangerous" to some degree when we start disabling NetP.
| private var isWaitlistEnabled: Bool { | ||
| switch featureOverrides.waitlistEnabled { | ||
| case .useRemoteValue: | ||
| return privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(NetworkProtectionSubfeature.waitlist) | ||
| case .on: | ||
| return true | ||
| case .off: | ||
| return false | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the gist of the overriding mechanism I'm proposing, where the client app takes care of overriding the flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it 👍
| case on | ||
| case off | ||
|
|
||
| static let `default`: WaitlistOverride = .on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default should change to .remote once we start the waitlist in our backend.
| private func disableNetworkProtectionForExternalUsers() { | ||
| #if DEBUG | ||
| if internalUserDecider.isInternalUser { | ||
| print("NetP Debug: Internal user detected. Network Protection is still enabled.") | ||
| } else { | ||
| print("NetP Debug: Network Protection was disabled.") | ||
| } | ||
| #endif | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No deleting anything yet to avoid breakage. I think we should review the exact conditions that would trigger this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to open a PR to turn the test feature flag on, so that this will never technically run for users for a few months. That gives us time to decide how to handle internal users properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up to my last comment, it's important to note that we should only include this when the bundled version of the config in the app includes the enabled flag. Otherwise, any F&F users who launch the browser will have NetP state removed, because the remote config won't have been fetched yet.
We could probably merge the privacy config PR on Friday, and then update the embedded copy of the config file as a part of this PR to solve that.
samsymons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll refine the conditions and wire up the waitlist state as a part of my PR.
Task/Issue URL: https://app.asana.com/0/0/1205381133187308/f iOS PR: duckduckgo/iOS#1967 macOS PR: duckduckgo/macos-browser#1562 What kind of version bump will this require?: Minor ## Description Adds the waitlist remote flags. --------- * Add the Network Protection feature and waitlist subfeature. * Rename NetworkProtectionFeatureVisibility to NetworkProtectionFeatureActivation. * Hardcode NetP on. * Adds the waitlistBetaActive remote subfeature * Removes an override --------- Co-authored-by: Sam Symons <[email protected]>
Task/Issue URL: https://app.asana.com/0/0/1205381133187310/f ## Related PRs BSK PR: duckduckgo/BrowserServicesKit#483 macOS PR: duckduckgo/macos-browser#1562 ## Description Integrates some of the latest changes from BSK. -------- Co-authored-by: Sam Symons <[email protected]>
# By Diego Rey Mendez # Via GitHub * develop: Implement waitlistBetaActive logic (without actually resetting) (#1562) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# By Alexey Martemyanov (5) and others # Via GitHub (1) and Tomas Strba (1) * develop: DBP Debug UI (#1587) Bump version to 1.55.0 (57) Update embedded files Auto start DBP scheduler (#1586) Add broker updater mechanism (#1580) Update develop with Bitwarden fix (#1585) fix outlook popups loading; set popup window mode to match Safari (#1564) remove AppActivityMonitor and related unused code (#1582) Popovers positioning (#1574) Version 1.54.1 xcode 15 synthesized color constants fixes (#1583) Fixes issue with password saving when using Bitwarden (#1584) Remove the incremental test pixel sender (#1578) Implement waitlistBetaActive logic (without actually resetting) (#1562) Lock Form fill when autofill is locked (#1559) show alert when user tries to open file in AppStore version (#1494) DBP UI Middleware (#1553) Dashboard & Profile Creation (#1567) roll out the bookmarks bar experiment (#1572) Open duck player for youtube same-document navigation (#1560) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # DuckDuckGo/Common/Localizables/UserText.swift # DuckDuckGo/NavigationBar/PinningManager.swift # DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift # DuckDuckGo/Waitlist/NetworkProtectionFeatureVisibility.swift # UnitTests/Menus/MoreOptionsMenuTests.swift
Task/Issue URL: https://app.asana.com/0/0/1205381133187306/f
Related PRs
BSK PR: duckduckgo/BrowserServicesKit#483
iOS PR: duckduckgo/iOS#1967
Description
Adds logic to handle the remote
waitlistBetaActivesubfeature, and to reset Network Protection once the beta is no longer active.Tests:
Before testing you'll want to apply the change suggested in this comment: https://github.com/duckduckgo/macos-browser/pull/1562/files#r1313326009
Filter your Xcode console by "NetP Debug"
Test 1: Easter Egg User + Waitlist Ended
In this test we're going to check that easter egg users have Network Protection enabled
Test 2: Waitlist User + Waitlist Ongoing
In this test we're going to check that Waitlist users can see Network Protection when the waitlist is enabled.
true.Test 3: Waitlist User + Waitlist Ended
In this test we're going to check that Waitlist users can see Network Protection when the waitlist is enabled.
true.Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation