Skip to content

Commit

Permalink
Enroll all internal users in experiment && Update BSK (#3359)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1204099484721401/1208292211771741/f

BSK PR: duckduckgo/BrowserServicesKit#994

Description:

We want all internal users enrolled in the experiment
Update in BSK to patch Privacy Config, so 'internal' is translated to 'enabled' when privacyConfig is passed to the FE
  • Loading branch information
afterxleep authored Sep 13, 2024
1 parent d5d9fbe commit 1c736e9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10853,7 +10853,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 194.0.0;
version = 194.1.0;
};
};
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" : "026acbd36fb80c95e0bfc6a9080e369dd85db66f",
"version" : "194.0.0"
"revision" : "09b4901eeab71625c4796c0819d0066278b7b6d6",
"version" : "194.1.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/AutofillLoginListViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 10 additions & 2 deletions DuckDuckGo/DuckPlayer/DuckPlayerLaunchExperiment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)? {
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/ImportPasswordsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/SpeechRecognizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/TabViewControllerBrowsingMenuExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c736e9

Please sign in to comment.