-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disables NetP when the waitlist is over #1588
Disables NetP when the waitlist is over #1588
Conversation
<menuItem title="Reset All State Keeping Invite" id="Mqz-Le-LgQ"> | ||
<modifierMask key="keyEquivalentModifierMask"/> | ||
<connections> | ||
<action selector="resetAllKeepingInvite:" target="Rah-lS-gno" id="ypd-Ao-CzY"/> | ||
</connections> | ||
</menuItem> | ||
<menuItem title="Reset All State" id="p4h-oC-tpw"> |
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.
Since I fixed "Reset All State" to truly reset all state, it felt to me we may still want to reset all state while keeping the invite code / auth token.
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.
👍 Agreed, this is very useful for debugging.
@@ -131,6 +131,8 @@ final class MoreOptionsMenu: NSMenu { | |||
addItem(withTitle: UserText.networkProtection, action: #selector(showNetworkProtectionStatus(_:)), keyEquivalent: "") | |||
.targetting(self) | |||
.withImage(.image(for: .vpnIcon)) | |||
} else { | |||
networkProtectionFeatureVisibility.disableForWaitlistUsers() |
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.
Disabling NetP at different points in the UI, and I'm making it a bit more explicit than before.
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.
Sounds good, I would like to also add some hooks to check feature flags when the privacy config changes, and when the app becomes active, just to make sure we're catching it as often as possible.
let featureVisibility = DefaultNetworkProtectionVisibility() | ||
|
||
if featureVisibility.isNetworkProtectionVisible() { | ||
showNetworkProtectionPopover(usingView: view, withDelegate: delegate) | ||
} else { | ||
featureVisibility.disableForWaitlistUsers() | ||
} |
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.
More waitlist verification walls.
guard case .alertFirstButtonReturn = await NSAlert.resetNetworkProtectionAlert().runModal() else { return } | ||
|
||
do { | ||
try await debugUtilities.resetAllState(keepAuthToken: true) |
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 new menu option.
@UserDefaultsWrapper(key: .networkProtectionOnboardingStatusRawValue, defaultValue: OnboardingStatus.default.rawValue, defaults: .shared) | ||
private(set) var onboardingStatusRawValue: OnboardingStatus.RawValue |
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.
Moving this to a specific class designed to disable NetP that we can use from the debug menu and from here.
try await removeSystemExtensionAndAgents() | ||
onboardingStatusRawValue = OnboardingStatus.default.rawValue | ||
func resetAllState(keepAuthToken: Bool) async throws { | ||
networkProtectionFeatureDisabler.disable(keepAuthToken: keepAuthToken, uninstallSystemExtension: true) |
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.
For the debug options we do want to reset the system extension.
networkProtectionFeatureDisabler.disableLoginItems() | ||
try await networkProtectionFeatureDisabler.disableSystemExtension() |
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.
Adjusting this to do these things all through the disabler.
guard isWaitlistUser else { | ||
return | ||
} | ||
|
||
print("NetP Debug: waitlist user - disabling NetP") | ||
#endif | ||
featureDisabler.disable(keepAuthToken: false, uninstallSystemExtension: 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.
It's wired, so we need to keep the isWaitlistUser
to false for now, because that interferes with easter egg users.
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!
…a small bug with a callback (#491) Task/Issue URL: https://app.asana.com/0/0/1205416442924462/f iOS PR: duckduckgo/iOS#1975 macOS PR: duckduckgo/macos-browser#1588 What kind of version bump will this require?: Patch ## Description When the extension receives a `resetAllState` message, it's now properly cleaning the stored auth token. Executes a callback that was missing.
Task/Issue URL: https://app.asana.com/0/0/1205416442924463/f BSK PR: duckduckgo/BrowserServicesKit#491 macOS PR: duckduckgo/macos-browser#1588 ## Description Integrates some changes from BSK that make NetP now clear the auth token in the extension when `resetAllState` is called. Also fixes a small bugfix with a callback not being called when it should.
# By Fernando Bunn (3) and others # Via GitHub * develop: Updates sorting for Autofill UI Logins (#1596) Update Scheduler (#1599) PacketTunnelProvider crash buttons (#1597) swizzle WKNavigationAction.request, return empty request if nil (#1595) Better error messages in DBP result screen (#1590) Disables NetP when the waitlist is over (#1588) Settings Sync Provider with support for syncing Email Protection (#1565) Tie Find In Page to Bookmarks Bar (#1591) Move LoginItem to its own package (#1577) Update post merge failed task description (#1589) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift # DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionDebugUtilities.swift # DuckDuckGo/Waitlist/NetworkProtectionFeatureVisibility.swift
Task/Issue URL: https://app.asana.com/0/0/1205416442924461/f BSK PR: duckduckgo/BrowserServicesKit#491 iOS PR: duckduckgo/iOS#1975 ## Description Disables NetP when the waitlist is over. Known limitation: we're not disabling NetP if the user interacts with the menu agent. This is something to discuss separately. # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # LocalPackages/DataBrokerProtection/Package.swift # LocalPackages/NetworkProtectionUI/Package.swift
Task/Issue URL: https://app.asana.com/0/0/1205416442924461/f
BSK PR: duckduckgo/BrowserServicesKit#491
iOS PR: duckduckgo/iOS#1975
Description
Disables NetP when the waitlist is over.
Known limitation: we're not disabling NetP if the user interacts with the menu agent. This is something to discuss separately.
Testing:
The following flag is intentionally set to false, since this PR does not know which user signed up for the waitlist beta. It's important to keep this to
false
until we know with certainty, as setting this to true means we would not have any easter-egg users.Test 1:
false
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation