Skip to content
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

Enroll all internal users in experiment && Update BSK #3359

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading