From 8afe33f271784bf12c7697e9bacd74c52207ebb7 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Fri, 13 Sep 2024 11:12:35 +0200 Subject: [PATCH 1/2] Enroll all internal users in experiment && Update BSK --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../DuckPlayer/DuckPlayerLaunchExperiment.swift | 12 ++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d609c580ca..c4cf68a272 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10852,8 +10852,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 193.2.0; + branch = daniel/css.parsing; + kind = branch; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 17a7b49fbc..e21863e8fc 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "0021e32b01baca06372e3479d4a33980d7af6618", - "version" : "193.2.0" + "branch" : "daniel/css.parsing", + "revision" : "5b41313f417a4d77b3672bfc6575d28505be8fed" } }, { diff --git a/DuckDuckGo/DuckPlayer/DuckPlayerLaunchExperiment.swift b/DuckDuckGo/DuckPlayer/DuckPlayerLaunchExperiment.swift index b809c7d5b9..19decaf548 100644 --- a/DuckDuckGo/DuckPlayer/DuckPlayerLaunchExperiment.swift +++ b/DuckDuckGo/DuckPlayer/DuckPlayerLaunchExperiment.swift @@ -91,6 +91,8 @@ final class DuckPlayerLaunchExperiment: DuckPlayerLaunchExperimentHandling { @UserDefaultsWrapper(key: .duckPlayerPixelExperimentCohort, defaultValue: nil) var experimentCohort: String? + private var isInternalUser: Bool + enum Cohort: String { case control case experiment @@ -100,11 +102,13 @@ final class DuckPlayerLaunchExperiment: DuckPlayerLaunchExperimentHandling { referrer: DuckPlayerReferrer? = nil, userDefaults: UserDefaults = UserDefaults.standard, pixel: DuckPlayerExperimentPixelFiring.Type = Pixel.self, - dateProvider: DuckPlayerExperimentDateProvider = DefaultDuckPlayerExperimentDateProvider()) { + dateProvider: DuckPlayerExperimentDateProvider = DefaultDuckPlayerExperimentDateProvider(), + isInternalUser: Bool = false) { self.referrer = referrer self.duckPlayerMode = duckPlayerMode self.pixel = pixel self.dateProvider = dateProvider + self.isInternalUser = isInternalUser } private var dates: (day: Int, week: Int)? { @@ -140,7 +144,11 @@ final class DuckPlayerLaunchExperiment: DuckPlayerLaunchExperimentHandling { func assignUserToCohort() { if !isEnrolled { - let cohort: Cohort = Bool.random() ? .experiment : .control + var cohort: Cohort = Bool.random() ? .experiment : .control + + if isInternalUser { + cohort = .experiment + } experimentCohort = cohort.rawValue enrollmentDate = dateProvider.currentDate fireEnrollmentPixel() From 8504cbb88da6be26218d91e37ab768a79a311c94 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Fri, 13 Sep 2024 12:24:21 +0200 Subject: [PATCH 2/2] Point to BSK Release --- Core/SyncErrorHandler.swift | 6 +++--- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/AutofillLoginListViewModel.swift | 2 +- DuckDuckGo/ImportPasswordsViewModel.swift | 2 +- DuckDuckGo/SpeechRecognizer.swift | 2 +- DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/SyncErrorHandler.swift b/Core/SyncErrorHandler.swift index 3c29fb3a99..a3ff07e794 100644 --- a/Core/SyncErrorHandler.swift +++ b/Core/SyncErrorHandler.swift @@ -39,21 +39,21 @@ public enum AsyncErrorType: String { public class SyncErrorHandler: EventMapping { @UserDefaultsWrapper(key: .syncBookmarksPaused, defaultValue: false) - private (set) public var isSyncBookmarksPaused: Bool { + private(set) public var isSyncBookmarksPaused: Bool { didSet { isSyncPausedChangedPublisher.send() } } @UserDefaultsWrapper(key: .syncCredentialsPaused, defaultValue: false) - private (set) public var isSyncCredentialsPaused: Bool { + private(set) public var isSyncCredentialsPaused: Bool { didSet { isSyncPausedChangedPublisher.send() } } @UserDefaultsWrapper(key: .syncIsPaused, defaultValue: false) - private (set) public var isSyncPaused: Bool { + private(set) public var isSyncPaused: Bool { didSet { isSyncPausedChangedPublisher.send() } diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index c4cf68a272..d9f651fc28 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10852,8 +10852,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { - branch = daniel/css.parsing; - kind = branch; + kind = exactVersion; + version = 194.1.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e21863e8fc..609c75b8c2 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "branch" : "daniel/css.parsing", - "revision" : "5b41313f417a4d77b3672bfc6575d28505be8fed" + "revision" : "09b4901eeab71625c4796c0819d0066278b7b6d6", + "version" : "194.1.0" } }, { diff --git a/DuckDuckGo/AutofillLoginListViewModel.swift b/DuckDuckGo/AutofillLoginListViewModel.swift index 5c2ff7a615..0bf99e6fe1 100644 --- a/DuckDuckGo/AutofillLoginListViewModel.swift +++ b/DuckDuckGo/AutofillLoginListViewModel.swift @@ -229,7 +229,7 @@ final class AutofillLoginListViewModel: ObservableObject { authenticator.logOut() } - func authenticate(completion: @escaping(AutofillLoginListAuthenticator.AuthError?) -> Void) { + func authenticate(completion: @escaping (AutofillLoginListAuthenticator.AuthError?) -> Void) { guard !isAuthenticating else { return } diff --git a/DuckDuckGo/ImportPasswordsViewModel.swift b/DuckDuckGo/ImportPasswordsViewModel.swift index 480eb27ef4..46b0e20cc5 100644 --- a/DuckDuckGo/ImportPasswordsViewModel.swift +++ b/DuckDuckGo/ImportPasswordsViewModel.swift @@ -79,7 +79,7 @@ final class ImportPasswordsViewModel { /// Keeping track on whether or not either button was pressed on this screen /// so that a pixel can be fired if the user navigates away without taking any action - private (set) var buttonWasPressed: Bool = false + private(set) var buttonWasPressed: Bool = false func maxButtonWidth() -> CGFloat { let maxWidth = maxWidthFor(title1: ButtonType.getBrowser.title, title2: ButtonType.sync.title) diff --git a/DuckDuckGo/SpeechRecognizer.swift b/DuckDuckGo/SpeechRecognizer.swift index 67e58d9377..119fbfedb8 100644 --- a/DuckDuckGo/SpeechRecognizer.swift +++ b/DuckDuckGo/SpeechRecognizer.swift @@ -101,7 +101,7 @@ final class SpeechRecognizer: NSObject, SpeechRecognizerProtocol { func startRecording(resultHandler: @escaping (_ text: String?, _ error: Error?, _ speechDidFinish: Bool) -> Void, - volumeCallback: @escaping(_ volume: Float) -> Void) { + volumeCallback: @escaping (_ volume: Float) -> Void) { recognitionRequest = SFSpeechAudioBufferRecognitionRequest() audioEngine = AVAudioEngine() diff --git a/DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift b/DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift index 0743776c30..12ef1e53ee 100644 --- a/DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift +++ b/DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift @@ -372,7 +372,7 @@ extension TabViewController { private func shareLinkWithTemporaryDownload(_ temporaryDownload: Download?, originalLink: Link, - completion: @escaping(Link) -> Void) { + completion: @escaping (Link) -> Void) { guard let download = temporaryDownload else { completion(originalLink) return