Skip to content

Commit

Permalink
Merge branch 'release/1.115.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed Nov 25, 2024
2 parents c934664 + 815708f commit 5a5bde3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 313
CURRENT_PROJECT_VERSION = 314
3 changes: 1 addition & 2 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

let isEnabled = privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(PrivacyProSubfeature.setAccessTokenCookieForSubscriptionDomains)

Task { [weak self] in
Task { @MainActor [weak self] in
if isEnabled {
self?.subscriptionCookieManager.enableSettingSubscriptionCookie()
await self?.subscriptionCookieManager.refreshSubscriptionCookie()
} else {
await self?.subscriptionCookieManager.disableSettingSubscriptionCookie()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ final class NewTabPageSearchBoxExperiment {
}

var cohort: Cohort? {
isActive ? dataStore.experimentCohort : nil
dataStore.experimentCohort
}

var onboardingCohort: PixelExperiment? {
Expand Down
11 changes: 6 additions & 5 deletions DuckDuckGo/NavigationBar/View/AddressBarTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ final class AddressBarTextField: NSTextField {

private func navigate(suggestion: Suggestion?) {
let ntpExperiment = NewTabPageSearchBoxExperiment()
let ntpExperimentCohort: NewTabPageSearchBoxExperiment.Cohort? = ntpExperiment.isActive ? ntpExperiment.cohort : nil
let source: NewTabPageSearchBoxExperiment.SearchSource? = {
guard ntpExperiment.isActive else {
return nil
Expand All @@ -349,17 +350,17 @@ final class AddressBarTextField: NSTextField {
let autocompletePixel: GeneralPixel? = {
switch suggestion {
case .phrase:
return .autocompleteClickPhrase(from: source, cohort: ntpExperiment.cohort, onboardingCohort: ntpExperiment.onboardingCohort)
return .autocompleteClickPhrase(from: source, cohort: ntpExperimentCohort, onboardingCohort: ntpExperiment.onboardingCohort)
case .website:
return .autocompleteClickWebsite(from: source, cohort: ntpExperiment.cohort, onboardingCohort: ntpExperiment.onboardingCohort)
return .autocompleteClickWebsite(from: source, cohort: ntpExperimentCohort, onboardingCohort: ntpExperiment.onboardingCohort)
case .bookmark(_, _, let isFavorite, _):
if isFavorite {
return .autocompleteClickFavorite(from: source, cohort: ntpExperiment.cohort, onboardingCohort: ntpExperiment.onboardingCohort)
return .autocompleteClickFavorite(from: source, cohort: ntpExperimentCohort, onboardingCohort: ntpExperiment.onboardingCohort)
} else {
return .autocompleteClickBookmark(from: source, cohort: ntpExperiment.cohort, onboardingCohort: ntpExperiment.onboardingCohort)
return .autocompleteClickBookmark(from: source, cohort: ntpExperimentCohort, onboardingCohort: ntpExperiment.onboardingCohort)
}
case .historyEntry:
return .autocompleteClickHistory(from: source, cohort: ntpExperiment.cohort, onboardingCohort: ntpExperiment.onboardingCohort)
return .autocompleteClickHistory(from: source, cohort: ntpExperimentCohort, onboardingCohort: ntpExperiment.onboardingCohort)
default:
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/HomePage/NewTabPageSearchBoxExperimentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ final class NewTabPageSearchBoxExperimentTests: XCTestCase {
XCTAssertFalse(experiment.isActive)
}

func testWhenExperimentIsInactiveThenCohortIsNil() {
func testWhenExperimentIsInactiveThenCohortStays() {
dataStore.didRunEnrollment = true
dataStore.experimentCohort = .experiment
dataStore.enrollmentDate = Date.daysAgo(NewTabPageSearchBoxExperiment.Const.experimentDurationInDays)

XCTAssertNil(experiment.cohort)
XCTAssertEqual(experiment.cohort, .experiment)
}

func testWhenExperimentIsInactiveThenOnboardingExperimentCohortIsNil() {
Expand Down

0 comments on commit 5a5bde3

Please sign in to comment.