Skip to content

Commit

Permalink
Merge branch 'main' into sam/add-rmf-survey-locale-parameter
Browse files Browse the repository at this point in the history
# By Bartek Waresiak (3) and others
# Via GitHub (1) and others
* main:
  Remove incorrect tests and reenable some of the non-flaky ones (#3653)
  Update BSK with version including Privacy Stats module for use in the macOS browser (#3651)
  point to BSK branch and updates (#3636)
  Release 7.147.0-6 (#3652)
  Revert incorrect push
  Client displays correct subscription (#3620)
  Re-enable pixel tests except for flaky one
  Remove Special Pages tests
  Include inactive tabs statistics in daily tab switcher pixel (#3643)
  Release 7.147.0-5 (#3649)
  [Release PR] Add StoreKit debugging metadata to the debug menu (#3637)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Nov 29, 2024
2 parents d1f87ff + 86d978a commit a0c9ce5
Show file tree
Hide file tree
Showing 40 changed files with 767 additions and 587 deletions.
24 changes: 19 additions & 5 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,27 @@ public enum FeatureFlag: String {

/// https://app.asana.com/0/1208592102886666/1208613627589762/f
case crashReportOptInStatusResetting
case isPrivacyProLaunchedROW
case isPrivacyProLaunchedROWOverride
}

extension FeatureFlag: FeatureFlagDescribing {

public static var localOverrideStoreName: String = "com.duckduckgo.app.featureFlag.localOverrides"

public var supportsLocalOverriding: Bool {
false
switch self {
case .isPrivacyProLaunchedROWOverride:
return true
default:
return false
}
}

public var source: FeatureFlagSource {
switch self {
case .debugMenu:
return .internalOnly
return .internalOnly()
case .sync:
return .remoteReleasable(.subfeature(SyncSubfeature.level0ShowSync))
case .autofillCredentialInjecting:
Expand Down Expand Up @@ -106,9 +116,9 @@ extension FeatureFlag: FeatureFlagDescribing {
case .syncPromotionPasswords:
return .remoteReleasable(.subfeature(SyncPromotionSubfeature.passwords))
case .onboardingHighlights:
return .internalOnly
return .internalOnly()
case .onboardingAddToDock:
return .internalOnly
return .internalOnly()
case .autofillSurveys:
return .remoteReleasable(.feature(.autofillSurveys))
case .autcompleteTabs:
Expand All @@ -122,7 +132,11 @@ extension FeatureFlag: FeatureFlagDescribing {
case .adAttributionReporting:
return .remoteReleasable(.feature(.adAttributionReporting))
case .crashReportOptInStatusResetting:
return .internalOnly
return .internalOnly()
case .isPrivacyProLaunchedROW:
return .remoteReleasable(.subfeature(PrivacyProSubfeature.isLaunchedROW))
case .isPrivacyProLaunchedROWOverride:
return .remoteReleasable(.subfeature(PrivacyProSubfeature.isLaunchedROWOverride))
}
}
}
Expand Down
72 changes: 34 additions & 38 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"branch" : "sam/add-rmf-survey-locale-parameter",
"revision" : "49d31fb741dd39446fd0ddfc70e36846191394e4"
"revision" : "dfd266ab6550902dc2511714f85e2cc03009c057",
"version" : "215.0.0"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "dfef00ef77f5181d1d8a4f7cc88f7b7c0514dd34",
"version" : "6.39.0"
"revision" : "c4bb146afdf0c7a93fb9a7d95b1cb255708a470d",
"version" : "6.41.0"
}
},
{
Expand Down Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"revision" : "757bbbae1e2afbb421caee9bfca04ee5c56c3af8",
"version" : "7.2.0"
"revision" : "49db79829dcb166b3524afdbc1c680890452ce1c",
"version" : "7.2.1"
}
},
{
Expand Down
29 changes: 26 additions & 3 deletions DuckDuckGo/AppDependencyProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ final class AppDependencyProvider: DependencyProvider {

private init() {
featureFlagger = DefaultFeatureFlagger(internalUserDecider: internalUserDecider,
privacyConfigManager: ContentBlocking.shared.privacyConfigurationManager)
privacyConfigManager: ContentBlocking.shared.privacyConfigurationManager,
localOverrides: FeatureFlagLocalOverrides(
keyValueStore: UserDefaults(suiteName: FeatureFlag.localOverrideStoreName)!,
actionHandler: FeatureFlagOverridesPublishingHandler<FeatureFlag>()
),
experimentManager: ExperimentCohortsManager(store: ExperimentsDataStore()),
for: FeatureFlag.self)

configurationManager = ConfigurationManager(store: configurationStore)

Expand All @@ -109,16 +115,33 @@ final class AppDependencyProvider: DependencyProvider {
let accessTokenStorage = SubscriptionTokenKeychainStorage(keychainType: .dataProtection(.named(subscriptionAppGroup)))
let subscriptionService = DefaultSubscriptionEndpointService(currentServiceEnvironment: subscriptionEnvironment.serviceEnvironment)
let authService = DefaultAuthEndpointService(currentServiceEnvironment: subscriptionEnvironment.serviceEnvironment)
let subscriptionFeatureMappingCache = DefaultSubscriptionFeatureMappingCache(subscriptionEndpointService: subscriptionService,
userDefaults: subscriptionUserDefaults)

let accountManager = DefaultAccountManager(accessTokenStorage: accessTokenStorage,
entitlementsCache: entitlementsCache,
subscriptionEndpointService: subscriptionService,
authEndpointService: authService)

let subscriptionManager = DefaultSubscriptionManager(storePurchaseManager: DefaultStorePurchaseManager(),
let theFeatureFlagger = featureFlagger
let subscriptionFeatureFlagger: FeatureFlaggerMapping<SubscriptionFeatureFlags> = FeatureFlaggerMapping { feature in
switch feature {
case .isLaunchedROW:
return theFeatureFlagger.isFeatureOn(.isPrivacyProLaunchedROW)
case .isLaunchedROWOverride:
return theFeatureFlagger.isFeatureOn(.isPrivacyProLaunchedROWOverride)
default:
return feature.defaultState
}
}

let subscriptionManager = DefaultSubscriptionManager(storePurchaseManager: DefaultStorePurchaseManager(subscriptionFeatureMappingCache: subscriptionFeatureMappingCache),
accountManager: accountManager,
subscriptionEndpointService: subscriptionService,
authEndpointService: authService,
subscriptionEnvironment: subscriptionEnvironment)
subscriptionFeatureMappingCache: subscriptionFeatureMappingCache,
subscriptionEnvironment: subscriptionEnvironment,
subscriptionFeatureFlagger: subscriptionFeatureFlagger)
accountManager.delegate = subscriptionManager

self.subscriptionManager = subscriptionManager
Expand Down
35 changes: 27 additions & 8 deletions DuckDuckGo/Debug.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,28 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" id="gpq-tH-ki5">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="Geg-YQ-MpF" detailTextLabel="zsc-Ui-Vd6" style="IBUITableViewCellStyleValue1" id="gpq-tH-ki5">
<rect key="frame" x="0.0" y="50" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="gpq-tH-ki5" id="Jxo-Ud-82c">
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Geg-YQ-MpF">
<rect key="frame" x="20" y="12" width="33" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="zsc-Ui-Vd6">
<rect key="frame" x="350" y="12" width="44" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
Expand All @@ -1031,17 +1047,17 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ConfigurationURLTableViewCell" id="i6Y-Di-PX3" customClass="ConfigurationURLTableViewCell" customModule="DuckDuckGo" customModuleProvider="target">
<rect key="frame" x="0.0" y="50" width="414" height="94.5"/>
<rect key="frame" x="0.0" y="50" width="414" height="95"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="i6Y-Di-PX3" id="qn4-gq-5fa">
<rect key="frame" x="0.0" y="0.0" width="414" height="94.5"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="95"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="pKD-Xm-Eu1">
<rect key="frame" x="20" y="11" width="374" height="72.5"/>
<rect key="frame" x="20" y="11" width="374" height="73"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="j3A-OZ-DWy">
<rect key="frame" x="0.0" y="0.0" width="44" height="72.5"/>
<rect key="frame" x="0.0" y="0.0" width="44" height="73"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gKw-J7-XIW">
<rect key="frame" x="0.0" y="0.0" width="44" height="24"/>
Expand All @@ -1051,22 +1067,22 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UrI-B0-rWf">
<rect key="frame" x="0.0" y="24" width="44" height="24"/>
<rect key="frame" x="0.0" y="24" width="44" height="24.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="accent"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6RK-ug-mZa">
<rect key="frame" x="0.0" y="48.5" width="44" height="24"/>
<rect key="frame" x="0.0" y="49" width="44" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nkj-yK-cgm">
<rect key="frame" x="350" y="0.0" width="24" height="72.5"/>
<rect key="frame" x="350" y="0.0" width="24" height="73"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="Reload-24"/>
</button>
Expand Down Expand Up @@ -1125,6 +1141,9 @@
<systemColor name="labelColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="secondaryLabelColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/NetworkProtectionRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct NetworkProtectionRootView: View {
let statusViewModel: NetworkProtectionStatusViewModel

init() {
let subscriptionManager = AppDependencyProvider.shared.subscriptionManager
let accountManager = AppDependencyProvider.shared.subscriptionManager.accountManager
let locationListRepository = NetworkProtectionLocationListCompositeRepository(accountManager: accountManager)
let usesUnifiedFeedbackForm = accountManager.isUserAuthenticated
Expand All @@ -35,7 +36,8 @@ struct NetworkProtectionRootView: View {
statusObserver: AppDependencyProvider.shared.connectionObserver,
serverInfoObserver: AppDependencyProvider.shared.serverInfoObserver,
locationListRepository: locationListRepository,
usesUnifiedFeedbackForm: usesUnifiedFeedbackForm)
usesUnifiedFeedbackForm: usesUnifiedFeedbackForm,
subscriptionManager: subscriptionManager)
}

var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/NetworkProtectionStatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ struct NetworkProtectionStatusView: View {

@ViewBuilder
private func about() -> some View {
let viewModel = UnifiedFeedbackFormViewModel(accountManager: AppDependencyProvider.shared.accountManager,
let viewModel = UnifiedFeedbackFormViewModel(subscriptionManager: statusModel.subscriptionManager,
apiService: DefaultAPIService(),
vpnMetadataCollector: DefaultVPNMetadataCollector(),
source: .vpn)
Expand Down
6 changes: 4 additions & 2 deletions DuckDuckGo/NetworkProtectionStatusViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,23 @@ final class NetworkProtectionStatusViewModel: ObservableObject {
@Published public var animationsOn: Bool = false

public let usesUnifiedFeedbackForm: Bool
public let subscriptionManager: SubscriptionManager

public init(tunnelController: (TunnelController & TunnelSessionProvider),
settings: VPNSettings,
statusObserver: ConnectionStatusObserver,
serverInfoObserver: ConnectionServerInfoObserver,
errorObserver: ConnectionErrorObserver = ConnectionErrorObserverThroughSession(),
locationListRepository: NetworkProtectionLocationListRepository,
usesUnifiedFeedbackForm: Bool) {

usesUnifiedFeedbackForm: Bool,
subscriptionManager: SubscriptionManager) {
self.tunnelController = tunnelController
self.settings = settings
self.statusObserver = statusObserver
self.serverInfoObserver = serverInfoObserver
self.errorObserver = errorObserver
self.usesUnifiedFeedbackForm = usesUnifiedFeedbackForm
self.subscriptionManager = subscriptionManager

statusMessage = Self.message(for: statusObserver.recentValue)
self.headerTitle = Self.titleText(status: statusObserver.recentValue)
Expand Down
Loading

0 comments on commit a0c9ce5

Please sign in to comment.