Skip to content

Commit

Permalink
Add a debug menu action to reset Remote Messages on macOS (#2972)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1199230911884351/1207797025533577/f

Description:
This change adds "Reset Remote Messages" action under Debug Menu -> Reset Data.
  • Loading branch information
ayoy authored Jul 15, 2024
1 parent eed9a0a commit 91f27c7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13310,7 +13310,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 171.0.0;
version = 171.1.0;
};
};
9FF521422BAA8FF300B9819B /* 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" : "9ee9b378060b94aeafba65c62e629953fec91093",
"version" : "171.0.0"
"revision" : "c9462f5a01ef4b298caea661981fa6cecff687b7",
"version" : "171.1.0"
}
},
{
Expand Down Expand Up @@ -75,7 +75,7 @@
{
"identity" : "lottie-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-spm",
"location" : "https://github.com/airbnb/lottie-spm.git",
"state" : {
"revision" : "1d29eccc24cc8b75bff9f6804155112c0ffc9605",
"version" : "4.4.3"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
var privacyDashboardWindow: NSWindow?

let activeRemoteMessageModel: ActiveRemoteMessageModel
private let remoteMessagingClient: RemoteMessagingClient!
let remoteMessagingClient: RemoteMessagingClient!

public let subscriptionManager: SubscriptionManager
public let subscriptionUIHandler: SubscriptionUIHandling
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Menus/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ final class MainMenu: NSMenu {
}
NSMenuItem(title: "Reset Email Protection InContext Signup Prompt", action: #selector(MainViewController.resetEmailProtectionInContextPrompt))
NSMenuItem(title: "Reset Pixels Storage", action: #selector(MainViewController.resetDailyPixels))
NSMenuItem(title: "Reset Remote Messages", action: #selector(AppDelegate.resetRemoteMessages))
}.withAccessibilityIdentifier("MainMenu.resetData")
NSMenuItem(title: "UI Triggers") {
NSMenuItem(title: "Show Save Credentials Popover", action: #selector(MainViewController.showSaveCredentialsPopover))
Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/Menus/MainMenuActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ extension AppDelegate {
}
}

@objc func resetRemoteMessages(_ sender: Any?) {
remoteMessagingClient.store?.resetRemoteMessages()
}
}

extension MainViewController {
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.0"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper"),
],
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.0"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"),
.package(path: "../AppLauncher"),
.package(path: "../UDSHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["SubscriptionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "171.1.0"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down
2 changes: 2 additions & 0 deletions UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ class MockRemoteMessagingStore: RemoteMessagingStoring {
shownRemoteMessagesIDs.removeAll(where: { $0 == id })
}
}

func resetRemoteMessages() {}
}

0 comments on commit 91f27c7

Please sign in to comment.