From c92b86502e0ea852ea3669e7c5e06e265becb4a8 Mon Sep 17 00:00:00 2001 From: Juan Manuel Pereira Date: Sun, 25 Aug 2024 20:33:40 -0300 Subject: [PATCH 1/5] Fix address bar queries when doing math expressions (#952) --- .../Common/Extensions/StringExtension.swift | 8 ++++- .../Extensions/StringExtensionTests.swift | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Sources/Common/Extensions/StringExtension.swift b/Sources/Common/Extensions/StringExtension.swift index 23fd37ad0..09050cfe2 100644 --- a/Sources/Common/Extensions/StringExtension.swift +++ b/Sources/Common/Extensions/StringExtension.swift @@ -31,6 +31,8 @@ extension RegEx { static let hostName = regex("^(((?!-)[A-Za-z0-9-]{1,63}(? Date: Mon, 26 Aug 2024 11:59:00 +0200 Subject: [PATCH 2/5] Freemium PIR - Add Desktop RMF Attribute (#960) Task/Issue URL: https://app.asana.com/0/1206488453854252/1208051900144618/f iOS PR: https://github.com/duckduckgo/iOS/pull/3275 macOS PR: https://github.com/duckduckgo/macos-browser/pull/3146 What kind of version bump will this require?: Major **Description**: Add Freemium PIR RMF attribute to allow targeting current Freemium PIR users with RMF messages. --- .../Matchers/UserAttributeMatcher.swift | 5 +++++ .../RemoteMessaging/Model/MatchingAttributes.swift | 5 +++++ .../Matchers/DesktopUserAttributeMatcherTests.swift | 13 +++++++++++++ 3 files changed, 23 insertions(+) diff --git a/Sources/RemoteMessaging/Matchers/UserAttributeMatcher.swift b/Sources/RemoteMessaging/Matchers/UserAttributeMatcher.swift index 20b56d994..39f14c631 100644 --- a/Sources/RemoteMessaging/Matchers/UserAttributeMatcher.swift +++ b/Sources/RemoteMessaging/Matchers/UserAttributeMatcher.swift @@ -98,6 +98,7 @@ public struct MobileUserAttributeMatcher: AttributeMatching { public struct DesktopUserAttributeMatcher: AttributeMatching { private let pinnedTabsCount: Int private let hasCustomHomePage: Bool + private let isCurrentFreemiumPIRUser: Bool private let dismissedDeprecatedMacRemoteMessageIds: [String] private let commonUserAttributeMatcher: CommonUserAttributeMatcher @@ -123,10 +124,12 @@ public struct DesktopUserAttributeMatcher: AttributeMatching { hasCustomHomePage: Bool, isDuckPlayerOnboarded: Bool, isDuckPlayerEnabled: Bool, + isCurrentFreemiumPIRUser: Bool, dismissedDeprecatedMacRemoteMessageIds: [String] ) { self.pinnedTabsCount = pinnedTabsCount self.hasCustomHomePage = hasCustomHomePage + self.isCurrentFreemiumPIRUser = isCurrentFreemiumPIRUser self.dismissedDeprecatedMacRemoteMessageIds = dismissedDeprecatedMacRemoteMessageIds commonUserAttributeMatcher = .init( @@ -158,6 +161,8 @@ public struct DesktopUserAttributeMatcher: AttributeMatching { return matchingAttribute.evaluate(for: pinnedTabsCount) case let matchingAttribute as CustomHomePageMatchingAttribute: return matchingAttribute.evaluate(for: hasCustomHomePage) + case let matchingAttribute as FreemiumPIRCurrentUserMatchingAttribute: + return matchingAttribute.evaluate(for: isCurrentFreemiumPIRUser) case let matchingAttribute as InteractedWithDeprecatedMacRemoteMessageMatchingAttribute: if dismissedDeprecatedMacRemoteMessageIds.contains(where: { messageId in StringArrayMatchingAttribute(matchingAttribute.value).matches(value: messageId) == .match diff --git a/Sources/RemoteMessaging/Model/MatchingAttributes.swift b/Sources/RemoteMessaging/Model/MatchingAttributes.swift index fe23790a0..becc8280e 100644 --- a/Sources/RemoteMessaging/Model/MatchingAttributes.swift +++ b/Sources/RemoteMessaging/Model/MatchingAttributes.swift @@ -191,6 +191,11 @@ struct DuckPlayerEnabledMatchingAttribute: SingleValueMatching { var fallback: Bool? } +struct FreemiumPIRCurrentUserMatchingAttribute: SingleValueMatching { + var value: Bool? + var fallback: Bool? +} + struct MessageShownMatchingAttribute: SingleValueMatching { var value: [String]? = [] var fallback: Bool? diff --git a/Tests/RemoteMessagingTests/Matchers/DesktopUserAttributeMatcherTests.swift b/Tests/RemoteMessagingTests/Matchers/DesktopUserAttributeMatcherTests.swift index d47d21707..ba4a27cb4 100644 --- a/Tests/RemoteMessagingTests/Matchers/DesktopUserAttributeMatcherTests.swift +++ b/Tests/RemoteMessagingTests/Matchers/DesktopUserAttributeMatcherTests.swift @@ -133,6 +133,18 @@ class DesktopUserAttributeMatcherTests: XCTestCase { .fail) } + // MARK: - FreemiumPIRCurrentUser + + func testWhenIsCurrentFreemiumPIRUserEnabledMatchesThenReturnMatch() throws { + XCTAssertEqual(matcher.evaluate(matchingAttribute: FreemiumPIRCurrentUserMatchingAttribute(value: false, fallback: nil)), + .match) + } + + func testWhenIsCurrentFreemiumPIRUserDoesNotMatchThenReturnFail() throws { + XCTAssertEqual(matcher.evaluate(matchingAttribute: FreemiumPIRCurrentUserMatchingAttribute(value: true, fallback: nil)), + .fail) + } + // MARK: - DeprecatedMacRemoteMessage func testWhenNoDismissedMessageIdsAreProvidedThenReturnFail() throws { @@ -186,6 +198,7 @@ class DesktopUserAttributeMatcherTests: XCTestCase { hasCustomHomePage: true, isDuckPlayerOnboarded: true, isDuckPlayerEnabled: false, + isCurrentFreemiumPIRUser: false, dismissedDeprecatedMacRemoteMessageIds: dismissedDeprecatedMacRemoteMessageIds ) } From 6cc0d8c6dd3f25f401b91d589aa8b9d2bafebb3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:09:44 +1000 Subject: [PATCH 3/5] Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `afb4f61` to `6133e7d` (#962) Bumps Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `afb4f61` to `6133e7d`. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/BrowserServicesKitTests/Resources/privacy-reference-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/BrowserServicesKitTests/Resources/privacy-reference-tests b/Tests/BrowserServicesKitTests/Resources/privacy-reference-tests index afb4f6128..6133e7d9d 160000 --- a/Tests/BrowserServicesKitTests/Resources/privacy-reference-tests +++ b/Tests/BrowserServicesKitTests/Resources/privacy-reference-tests @@ -1 +1 @@ -Subproject commit afb4f6128a3b50d53ddcb1897ea1fb4df6858aa1 +Subproject commit 6133e7d9d9cd5f1b925cab1971b4d785dc639df7 From 93fae8b6986a68bde9a4f59d2d5b739903723a8a Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Tue, 27 Aug 2024 12:22:55 +0000 Subject: [PATCH 4/5] bump privacy-dashboard to 5.1.1 (#955) Please review the release process for BrowserServicesKit [here](https://app.asana.com/0/1200194497630846/1200837094583426). **Required**: Task/Issue URL: https://app.asana.com/0/1201141132935289/1208120896581722/f iOS PR: https://github.com/duckduckgo/iOS/pull/3267 macOS PR: https://github.com/duckduckgo/macos-browser/pull/3136 What kind of version bump will this require?: Patch **Optional**: Tech Design URL: CC: **Description**: See the parent task: https://app.asana.com/0/1201141132935289/1208095732465153 **Steps to test this PR**: 1. 1. **OS Testing**: * [ ] iOS 14 * [ ] iOS 15 * [ ] iOS 16 * [ ] macOS 10.15 * [ ] macOS 11 * [ ] macOS 12 --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) Co-authored-by: Shane Osbourne --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index b605bdc37..24049ed89 100644 --- a/Package.resolved +++ b/Package.resolved @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "36dc07cba4bc1e7e0c1d1fb679c3cd077694a072", - "version" : "5.0.0" + "revision" : "665b23dc656c9f787494620494f8e56098a900b2", + "version" : "5.1.1" } }, { diff --git a/Package.swift b/Package.swift index 1363c2887..deace9775 100644 --- a/Package.swift +++ b/Package.swift @@ -49,7 +49,7 @@ let package = Package( .package(url: "https://github.com/duckduckgo/sync_crypto", exact: "0.2.0"), .package(url: "https://github.com/gumob/PunycodeSwift.git", exact: "2.1.0"), .package(url: "https://github.com/duckduckgo/content-scope-scripts", exact: "6.7.0"), - .package(url: "https://github.com/duckduckgo/privacy-dashboard", exact: "5.0.0"), + .package(url: "https://github.com/duckduckgo/privacy-dashboard", exact: "5.1.1"), .package(url: "https://github.com/httpswift/swifter.git", exact: "1.5.0"), .package(url: "https://github.com/duckduckgo/bloom_cpp.git", exact: "3.0.0"), .package(url: "https://github.com/duckduckgo/wireguard-apple", exact: "1.1.3"), From 606ccf9e86f5cad3ae83132f46241357feecf152 Mon Sep 17 00:00:00 2001 From: Anh Do <18567+quanganhdo@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:21:03 -0400 Subject: [PATCH 5/5] Unified feedback form for Privacy Pro (#922) Please review the release process for BrowserServicesKit [here](https://app.asana.com/0/1200194497630846/1200837094583426). **Required**: Task/Issue URL: https://app.asana.com/0/1205922231854923/1207701941801991/f iOS PR: https://github.com/duckduckgo/iOS/pull/3172 macOS PR: https://github.com/duckduckgo/macos-browser/pull/3058 What kind of version bump will this require?: Major/Minor/Patch **Optional**: Tech Design URL: CC: **Description**: **Steps to test this PR**: 1. 1. **OS Testing**: * [ ] iOS 14 * [ ] iOS 15 * [ ] iOS 16 * [ ] macOS 10.15 * [ ] macOS 11 * [ ] macOS 12 --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) --- .../PrivacyConfig/Features/PrivacyFeature.swift | 1 + .../Subscription/SubscriptionFeatureAvailability.swift | 5 +++++ Sources/PixelKit/PixelKit+Parameters.swift | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift index c740a73dd..3eef7c05a 100644 --- a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift +++ b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift @@ -117,6 +117,7 @@ public enum PrivacyProSubfeature: String, Equatable, PrivacySubfeature { case allowPurchaseStripe case isLaunchedOverride case isLaunchedOverrideStripe + case useUnifiedFeedback } public enum sslCertificatesSubfeature: String, PrivacySubfeature { diff --git a/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift b/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift index 1fb03ce44..6a4f04879 100644 --- a/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift +++ b/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift @@ -22,6 +22,7 @@ import Subscription public protocol SubscriptionFeatureAvailability { var isFeatureAvailable: Bool { get } var isSubscriptionPurchaseAllowed: Bool { get } + var usesUnifiedFeedbackForm: Bool { get } } public final class DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAvailability { @@ -52,6 +53,10 @@ public final class DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAv return isPurchaseAllowed || isInternalUser } + public var usesUnifiedFeedbackForm: Bool { + privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(PrivacyProSubfeature.useUnifiedFeedback) + } + // MARK: - Conditions private var isInternalUser: Bool { diff --git a/Sources/PixelKit/PixelKit+Parameters.swift b/Sources/PixelKit/PixelKit+Parameters.swift index 8941b0e1c..2e846b32c 100644 --- a/Sources/PixelKit/PixelKit+Parameters.swift +++ b/Sources/PixelKit/PixelKit+Parameters.swift @@ -70,6 +70,14 @@ public extension PixelKit { public static let reason = "reason" public static let vpnCohort = "cohort" + + // Unified Feedback Form + public static let pproIssueDescription = "description" + public static let pproIssueSource = "source" + public static let pproIssueReportType = "reportType" + public static let pproIssueCategory = "category" + public static let pproIssueSubcategory = "subcategory" + public static let pproIssueMetadata = "customMetadata" } enum Values {