Skip to content

Commit

Permalink
Existing experiment disabled, the new Settings experiment activated (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstrba committed May 1, 2024
1 parent dbeab68 commit 985efac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
5 changes: 2 additions & 3 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ public struct VariantIOS: Variant {
VariantIOS(name: "sc", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),

VariantIOS(name: "mc", weight: 1, isIncluded: When.inEnglish, features: [.newSuggestionLogic]),
VariantIOS(name: "md", weight: 1, isIncluded: When.inEnglish, features: [.history]),
VariantIOS(name: "mc", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.newSuggestionLogic]),
VariantIOS(name: "md", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.history]),

returningUser
]
Expand Down
7 changes: 2 additions & 5 deletions Core/PixelExperiment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public enum PixelExperiment: String, CaseIterable {

/// Enables this experiment for new users when called from the new installation path.
public static func install() {
// Disable the experiment until all other experiments are finished
logic.install()
}

Expand Down Expand Up @@ -101,12 +100,10 @@ final internal class PixelExperimentLogic {

// Allocate user to a cohort based on the random number
let cohort: PixelExperiment
if randomNumber < 5 {
if randomNumber < 50 {
cohort = .control
} else if randomNumber < 10 {
cohort = .newSettings
} else {
cohort = .noVariant
cohort = .newSettings
}

// Store and use the selected cohort
Expand Down
3 changes: 1 addition & 2 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
DaxDialogs.shared.primeForUse()
}

// Experiment installation will be uncommented once we decide to run the experiment
// PixelExperiment.install()
PixelExperiment.install()

// MARK: Sync initialisation

Expand Down
7 changes: 5 additions & 2 deletions DuckDuckGo/SettingsRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ struct SettingsRootView: View {
}
})

.onReceive(viewModel.$deepLinkTarget, perform: { link in
guard let link else { return }
.onReceive(viewModel.$deepLinkTarget.removeDuplicates(), perform: { link in
guard let link, link != self.deepLinkTarget else {
return
}

self.deepLinkTarget = link

switch link.type {
Expand Down

0 comments on commit 985efac

Please sign in to comment.