From 1763a0196de68413a8011cb57094403ec8894aff Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Thu, 1 Aug 2024 21:09:08 -0700 Subject: [PATCH 1/3] Set BSK branch. --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- .../RemoteMessagingConfigMatcherProvider.swift | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index a7ac0500a2..7f203db81d 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13375,8 +13375,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 177.0.1; + branch = "sam/add-rmf-message-shown-attribute"; + kind = branch; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 5d286a84d1..0fc1853a1f 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "8623ea8296f93efb59320aed8b0f6705f366f89b", - "version" : "177.0.1" + "branch" : "sam/add-rmf-message-shown-attribute", + "revision" : "eed68fe76825b427a2fbc10435b4df1a9bf2737b" } }, { diff --git a/DuckDuckGo/RemoteMessaging/RemoteMessagingConfigMatcherProvider.swift b/DuckDuckGo/RemoteMessaging/RemoteMessagingConfigMatcherProvider.swift index 5aac8a4f14..d6a11fdc05 100644 --- a/DuckDuckGo/RemoteMessaging/RemoteMessagingConfigMatcherProvider.swift +++ b/DuckDuckGo/RemoteMessaging/RemoteMessagingConfigMatcherProvider.swift @@ -124,6 +124,7 @@ final class RemoteMessagingConfigMatcherProvider: RemoteMessagingConfigMatcherPr } let dismissedMessageIds = store.fetchDismissedRemoteMessageIDs() + let shownMessageIds = store.fetchShownRemoteMessageIDs() #if APPSTORE let isInstalledMacAppStore = true @@ -155,6 +156,7 @@ final class RemoteMessagingConfigMatcherProvider: RemoteMessagingConfigMatcherPr isPrivacyProSubscriptionExpiring: isPrivacyProSubscriptionExpiring, isPrivacyProSubscriptionExpired: isPrivacyProSubscriptionExpired, dismissedMessageIds: dismissedMessageIds, + shownMessageIds: shownMessageIds, pinnedTabsCount: pinnedTabsManager.tabCollection.tabs.count, hasCustomHomePage: startupPreferencesPersistor().launchToCustomHomePage, isDuckPlayerOnboarded: duckPlayerPreferencesPersistor.youtubeOverlayAnyButtonPressed, From dd7ae6dbeb405c62a011a3a862a4e1f4cade9437 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Thu, 1 Aug 2024 21:30:06 -0700 Subject: [PATCH 2/3] Update test suite. --- UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift b/UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift index e1d9fd397f..46c967eeab 100644 --- a/UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift +++ b/UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift @@ -25,6 +25,7 @@ class MockRemoteMessagingStore: RemoteMessagingStoring { var fetchScheduledRemoteMessageCalls = 0 var fetchRemoteMessageCalls = 0 var hasShownRemoteMessageCalls = 0 + var fetchShownRemoteMessageIdsCalls = 0 var hasDismissedRemoteMessageCalls = 0 var dismissRemoteMessageCalls = 0 var fetchDismissedRemoteMessageIdsCalls = 0 @@ -74,6 +75,11 @@ class MockRemoteMessagingStore: RemoteMessagingStoring { return shownRemoteMessagesIDs.contains(id) } + func fetchShownRemoteMessageIDs() -> [String] { + fetchShownRemoteMessageIdsCalls += 1 + return shownRemoteMessagesIDs + } + func hasDismissedRemoteMessage(withID id: String) -> Bool { hasDismissedRemoteMessageCalls += 1 return dismissedRemoteMessagesIDs.contains(id) From 6e0d737f05d6f515c6947254f8e96123b58a40ff Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Sun, 4 Aug 2024 12:41:26 -0700 Subject: [PATCH 3/3] Set BSK to 179.0.0. --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 58947dc20f..388a3a24fa 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13370,7 +13370,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 178.0.0; + version = 179.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2fa187fb00..03c1723785 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "ebad3db46e09913ac4c0e0c62085dcb40a6d6253", - "version" : "178.0.0" + "revision" : "dfddead0e1e4735a021d3affb05b64fea561a807", + "version" : "179.0.0" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 6785bcd498..541a8544e5 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index bb1cbb7e17..5447680251 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index c87fc52740..6f04c63220 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [