Skip to content

Commit

Permalink
Add support for targetPercentile RMF rule parameter (#2824)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1207234800675204/f
Tech Design URL:
CC:

Description:

Client PR for duckduckgo/BrowserServicesKit#809.

This adds support for the targetPercentile feature of RMF.
  • Loading branch information
samsymons authored May 15, 2024
1 parent cb58823 commit 4a31402
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9826,7 +9826,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 144.0.7;
version = 145.0.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "c1ce2cb5015890868bac3be85fbac3794ab30cb4",
"version" : "144.0.7"
"revision" : "6568d48c381042275c1936c6301a5100dea1c278",
"version" : "145.0.0"
}
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/RemoteMessaging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ struct RemoteMessaging {
isWidgetInstalled: isWidgetInstalled,
isNetPWaitlistUser: isNetworkProtectionWaitlistUser,
daysSinceNetPEnabled: daysSinceNetworkProtectionEnabled),
percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: .standard),
dismissedMessageIds: remoteMessagingStore.fetchDismissedRemoteMessageIds()
)

Expand Down
9 changes: 7 additions & 2 deletions DuckDuckGoTests/RemoteMessagingStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ import CoreData

class RemoteMessagingStoreTests: XCTestCase {

private var data = JsonTestDataLoader()
static let userDefaultsSuiteName = "remote-messaging-store-tests"

private var data = JsonTestDataLoader()
private var store: RemoteMessagingStore!

private let notificationCenter = NotificationCenter()
private var defaults: UserDefaults!

override func setUpWithError() throws {
try super.setUpWithError()
let container = CoreData.remoteMessagingContainer()
let context = container.viewContext
store = RemoteMessagingStore(context: context, notificationCenter: notificationCenter)

defaults = UserDefaults(suiteName: Self.userDefaultsSuiteName)!
defaults.removePersistentDomain(forName: Self.userDefaultsSuiteName)
}

override func tearDownWithError() throws {
Expand Down Expand Up @@ -139,6 +143,7 @@ class RemoteMessagingStoreTests: XCTestCase {
isWidgetInstalled: false,
isNetPWaitlistUser: false,
daysSinceNetPEnabled: -1),
percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: self.defaults),
dismissedMessageIds: []
)

Expand Down

0 comments on commit 4a31402

Please sign in to comment.