-
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
DBP: Integrate subscription account authentication to DBP #1995
Conversation
@objc private func handleAccountDidSignIn() { | ||
guard let token = accountManager.token else { | ||
Pixel.fire(.dataBrokerProtectionSubscriptionErrorWhenFetchingToken) | ||
assertionFailure("[DBP Subscription] AccountManager signed in but token could not be retrieved") |
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.
@samsymons I know this is unlikely, but I wonder if I should add a safeguard somewhere else for this to happen.
For example, fetching the token again before using it (if no token is present). What are your thoughts?
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 think in this case we're good since we're reacting to a sign in event. But, we can talk with Michał about it to be sure – I am of the opinion that we should only need to access the token, and the underlying subscription logic should ensure that we always get the latest.
@@ -73,6 +73,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel | |||
private var emailCancellables = Set<AnyCancellable>() | |||
let bookmarksManager = LocalBookmarkManager.shared | |||
|
|||
#if DBP && SUBSCRIPTION |
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've been adding some of these checks myself as a part of the remote messaging change. Once we enable these features in the App Store target, we should be good to remove the flags.
case .dataBrokerProtectionSubscriptionErrorWhenFetchingToken: | ||
return "m_mac_dbp_subscription_error_when_fetching_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.
Note that this will need privacy triage, but we can probably just include it in a larger Privacy Pro integration privacy triage later, since this pixel isn't going out to any users (even internally) just yet.
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.
Makes sense. I will leave a note on Asana so we do not forget.
|
||
@objc private func handleAccountDidSignIn() { | ||
guard let token = accountManager.token else { | ||
Pixel.fire(.dataBrokerProtectionSubscriptionErrorWhenFetchingToken) |
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'd consider renaming this pixel to something very specific, or adding an error
parameter to the pixel that includes something like noAccountManagerTokenFound
. Then we can add other error types in the future, if they become relevant.
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.
Agree. I will rename it to dataBrokerProtectionErrorWhenFetchingSubscriptionAuthTokenAfterSignIn
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, worked as expected. I added a couple non-blocking comments here and there. Thanks!
# By Dominik Kapusta (41) and others # Via Dominik Kapusta (9) and others * main: (138 commits) Make sure when we set custom config url, we don't expect etag in return (#1994) Add PixelKit source parameter (#1989) Fix internal user toggling (#2000) Show alert and display warning icon in Sync Settings when data syncing is disabled (#1996) DBP: Integrate subscription account authentication to DBP (#1995) Improve bookmarks html reader (#1986) Add Sync feature flags (#1992) Add daily stats pixel (#1993) Do not reload DBP tab when switching to it (#1942) Fix: external application requests via redirect URLs shows wrong origin. (#1900) Update clean-app.sh to work on macOS Sonoma and include NetP containers (#1988) Fix: "SwiftLintPlugin" must be enabled before it can be used (#1987) Prevent VPN server list persistence failures (#1985) add test can remove data (#1980) Remove VPN upgrade card (#1983) Fix low-res VPN warning asset (#1984) DBP: Fix unreliable date tests (#1981) Add search retention pixel for NetP (#1964) Sabrina/sync e2e tests (#1959) swiftlint build plugin (#1318) ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # DuckDuckGo/Application/AppDelegate.swift
# By Dominik Kapusta (2) and others # Via GitHub * main: Make sure when we set custom config url, we don't expect etag in return (#1994) Add PixelKit source parameter (#1989) Fix internal user toggling (#2000) Show alert and display warning icon in Sync Settings when data syncing is disabled (#1996) DBP: Integrate subscription account authentication to DBP (#1995) Improve bookmarks html reader (#1986) Add Sync feature flags (#1992) Add daily stats pixel (#1993) Do not reload DBP tab when switching to it (#1942) Fix: external application requests via redirect URLs shows wrong origin. (#1900) # Conflicts: # DuckDuckGo/Statistics/PixelEvent.swift
Task
https://app.asana.com/0/1204006570077678/1206163442459077/f
Description
Steps to test
Test everything works as expected
baseUrl
onEmailService
andCaptchaService
to point to staging (dbp-staging.duckduckgo.com)Test the default browser target