Skip to content

Commit

Permalink
Merge branch 'main' into dominik/sentry-appstore
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Apr 12, 2024
2 parents 4f1c92d + bab362b commit cb0bb65
Show file tree
Hide file tree
Showing 22 changed files with 382 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 159
CURRENT_PROJECT_VERSION = 161
4 changes: 4 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3345,6 +3345,7 @@
EEC589DA2A4F1CE400BCD60C /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEAD7A6E2A1D3E1F002A24E7 /* AppLauncher.swift */; };
EEC589DB2A4F1CE700BCD60C /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEAD7A6E2A1D3E1F002A24E7 /* AppLauncher.swift */; };
EEC589DC2A4F1CE800BCD60C /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEAD7A6E2A1D3E1F002A24E7 /* AppLauncher.swift */; };
EEC7BE2E2BC6C09500F86835 /* AddressBarKeyboardShortcutsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC7BE2D2BC6C09400F86835 /* AddressBarKeyboardShortcutsTests.swift */; };
EEC8EB3E2982CA3B0065AA39 /* JSAlertViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC111E5294D06290086524F /* JSAlertViewModel.swift */; };
EEC8EB3F2982CA440065AA39 /* JSAlert.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEC111E3294D06020086524F /* JSAlert.storyboard */; };
EEC8EB402982CD550065AA39 /* JSAlertViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEF53E172950CED5002D78F4 /* JSAlertViewModelTests.swift */; };
Expand Down Expand Up @@ -4807,6 +4808,7 @@
EEC4A6682B2C87D300F7C0AA /* VPNLocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLocationView.swift; sourceTree = "<group>"; };
EEC4A66C2B2C894F00F7C0AA /* VPNLocationPreferenceItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLocationPreferenceItemModel.swift; sourceTree = "<group>"; };
EEC4A6702B2C90AB00F7C0AA /* VPNLocationPreferenceItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLocationPreferenceItem.swift; sourceTree = "<group>"; };
EEC7BE2D2BC6C09400F86835 /* AddressBarKeyboardShortcutsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddressBarKeyboardShortcutsTests.swift; sourceTree = "<group>"; };
EECE10E429DD77E60044D027 /* FeatureFlag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlag.swift; sourceTree = "<group>"; };
EED735352BB46B6000F173D6 /* AutocompleteTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutocompleteTests.swift; sourceTree = "<group>"; };
EEDE50102BA360C80017F3C4 /* NetworkProtection+VPNAgentConvenienceInitializers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NetworkProtection+VPNAgentConvenienceInitializers.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6581,6 +6583,7 @@
isa = PBXGroup;
children = (
EEBCE6802BA444FA00B9DF00 /* Common */,
EEC7BE2D2BC6C09400F86835 /* AddressBarKeyboardShortcutsTests.swift */,
EED735352BB46B6000F173D6 /* AutocompleteTests.swift */,
EE54F7B22BBFEA48006218DB /* BookmarksAndFavoritesTests.swift */,
EE7F74902BB5D76600CD9456 /* BookmarksBarTests.swift */,
Expand Down Expand Up @@ -12320,6 +12323,7 @@
EE0429E02BA31D2F009EB20F /* FindInPageTests.swift in Sources */,
EE02D4212BB460FE00DBE6B3 /* StringExtension.swift in Sources */,
EE9D81C32BC57A3700338BE3 /* StateRestorationTests.swift in Sources */,
EEC7BE2E2BC6C09500F86835 /* AddressBarKeyboardShortcutsTests.swift in Sources */,
EE54F7B32BBFEA49006218DB /* BookmarksAndFavoritesTests.swift in Sources */,
EE02D4222BB4611A00DBE6B3 /* TestsURLExtension.swift in Sources */,
7B4CE8E726F02135009134B1 /* TabBarTests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"branch" : "dominik/sentry-appstore",
"revision" : "f6ac4b52028be3b60fadc4cd2bb7d2c11fcf59cf"
"revision" : "21a9a111d64ffb162c44a89f706763d2b8f8b167"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "62d5dc3d02f6a8347dc5f0b52162a0107d38b74c",
"version" : "5.8.0"
"revision" : "1bb3bc5eb565735051f342a87b5405d4374876c7",
"version" : "5.12.0"
}
},
{
Expand Down Expand Up @@ -95,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"revision" : "620921fea14569eb00745cb5a44890d5890d99ec",
"version" : "3.4.0"
"revision" : "14b13d0c3db38f471ce4ba1ecb502ee1986c84d7",
"version" : "3.5.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "killall tests-server&#10;# integration tests resources dir&#10;pushd &quot;${METAL_LIBRARY_OUTPUT_DIR}&quot;&#10;&quot;${BUILT_PRODUCTS_DIR}/tests-server&quot; &amp;&#10;popd&#10;">
scriptText = "&quot;${PROJECT_DIR}/clean-app.sh&quot; review&#10;defaults write com.duckduckgo.macos.browser.review moveToApplicationsFolderAlertSuppress 1&#10;killall tests-server&#10;# integration tests resources dir&#10;pushd &quot;${METAL_LIBRARY_OUTPUT_DIR}&quot;&#10;&quot;${BUILT_PRODUCTS_DIR}/tests-server&quot; &amp;&#10;popd&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down
2 changes: 2 additions & 0 deletions DuckDuckGo/Application/URLEventHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ final class URLEventHandler {
WindowControllersManager.shared.showPreferencesTab(withSelectedPane: .vpn)
case AppLaunchCommand.shareFeedback.launchURL:
WindowControllersManager.shared.showShareFeedbackModal()
case AppLaunchCommand.justOpen.launchURL:
WindowControllersManager.shared.showNewWindow()
case AppLaunchCommand.showVPNLocations.launchURL:
WindowControllersManager.shared.showPreferencesTab(withSelectedPane: .vpn)
WindowControllersManager.shared.showLocationPickerSheet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension UserText {
// "network.protection.system.extension.unknown.activation.error" - Message shown to users when they try to enable NetP and there is an unexpected activation error.
static let networkProtectionUnknownActivationError = "There as an unexpected error. Please try again."
// "network.protection.system.extension.please.reboot" - Message shown to users when they try to enable NetP and they need to reboot the computer to complete the installation
static let networkProtectionPleaseReboot = "Please reboot to activate the VPN"
static let networkProtectionPleaseReboot = "VPN update available. Restart your Mac to reconnect."
}

// MARK: - VPN Waitlist
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Menus/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ import SubscriptionUI
// swiftlint:disable:next function_body_length
private func setupDebugMenu() -> NSMenu {
let debugMenu = NSMenu(title: "Debug") {
NSMenuItem(title: "Open Vanilla Browser", action: #selector(MainViewController.openVanillaBrowser))
NSMenuItem(title: "Open Vanilla Browser", action: #selector(MainViewController.openVanillaBrowser)).withAccessibilityIdentifier("MainMenu.openVanillaBrowser")
NSMenuItem.separator()
NSMenuItem(title: "Reset Data") {
NSMenuItem(title: "Reset Default Browser Prompt", action: #selector(MainViewController.resetDefaultBrowserPrompt))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ extension NavigationBarViewController: NSMenuDelegate {
.store(in: &cancellables)

networkProtectionButtonModel.$showButton
.removeDuplicates()
.receive(on: RunLoop.main)
.sink { [weak self] show in
let isPopUpWindow = self?.view.window?.isPopUpWindow ?? false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
case networkProtectionRekeyCompleted
case networkProtectionRekeyFailure(_ error: Error)

case networkProtectionSystemExtensionActivationFailure
case networkProtectionSystemExtensionActivationFailure(_ error: Error)

case networkProtectionUnhandledError(function: String, line: Int, error: Error)

Expand Down Expand Up @@ -393,8 +393,7 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
.networkProtectionWireguardErrorCannotStartWireguardBackend,
.networkProtectionNoAuthTokenFoundError,
.networkProtectionRekeyAttempt,
.networkProtectionRekeyCompleted,
.networkProtectionSystemExtensionActivationFailure:
.networkProtectionRekeyCompleted:
return nil
case .networkProtectionClientFailedToRedeemInviteCode(let error),
.networkProtectionClientFailedToFetchLocations(let error),
Expand All @@ -408,7 +407,8 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
.networkProtectionClientFailedToParseRedeemResponse(let error),
.networkProtectionWireguardErrorCannotSetNetworkSettings(let error),
.networkProtectionRekeyFailure(let error),
.networkProtectionUnhandledError(_, _, let error):
.networkProtectionUnhandledError(_, _, let error),
.networkProtectionSystemExtensionActivationFailure(let error):
return error
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
controllerErrorStore.lastErrorMessage = UserText.networkProtectionSystemSettings
case SystemExtensionRequestError.unknownRequestResult:
controllerErrorStore.lastErrorMessage = UserText.networkProtectionUnknownActivationError
case SystemExtensionRequestError.willActivateAfterReboot:
case OSSystemExtensionError.extensionNotFound,
SystemExtensionRequestError.willActivateAfterReboot:
controllerErrorStore.lastErrorMessage = UserText.networkProtectionPleaseReboot
default:
controllerErrorStore.lastErrorMessage = error.localizedDescription
}

PixelKit.fire(
NetworkProtectionPixelEvent.networkProtectionSystemExtensionActivationFailure,
NetworkProtectionPixelEvent.networkProtectionSystemExtensionActivationFailure(error),
frequency: .standard,
withError: error,
includeAppVersionParameter: true
)

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Preferences/View/PreferencesGeneralView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ extension Preferences {

// SECTION 3: Search Settings
PreferencePaneSection(UserText.privateSearch) {
ToggleMenuItem(UserText.showAutocompleteSuggestions, isOn: $searchModel.showAutocompleteSuggestions)
ToggleMenuItem(UserText.showAutocompleteSuggestions, isOn: $searchModel.showAutocompleteSuggestions).accessibilityIdentifier("PreferencesGeneralView.showAutocompleteSuggestions")
}

// SECTION 4: Downloads
Expand Down
7 changes: 7 additions & 0 deletions DuckDuckGo/Windows/View/WindowControllersManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ extension WindowControllersManager {
}
}

func showNewWindow() {
guard WindowControllersManager.shared.lastKeyMainWindowController == nil else { return }
let tabCollection = TabCollection(tabs: [])
let tabCollectionViewModel = TabCollectionViewModel(tabCollection: tabCollection)
_ = WindowsManager.openNewWindow(with: tabCollectionViewModel)
}

func showLocationPickerSheet() {
let locationsViewController = VPNLocationsHostingViewController()
let locationsWindowController = locationsViewController.wrappedInWindowController()
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGoVPN/NetworkExtensionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension NetworkExtensionController {

NetworkProtectionLastVersionRunStore(userDefaults: defaults).lastExtensionVersionRun = extensionVersion

try? await Task.sleep(nanoseconds: 300 * NSEC_PER_MSEC)
try await Task.sleep(nanoseconds: 300 * NSEC_PER_MSEC)
#endif
}

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: "133.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "134.0.0"),
.package(path: "../PixelKit"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ public enum DataBrokerProtectionSchedulerStatus: Codable {
}

@objc
public class DataBrokerProtectionSchedulerErrorCollection: NSObject {
public class DataBrokerProtectionSchedulerErrorCollection: NSObject, NSSecureCoding {
/*
This needs to be an NSObject (rather than a struct) so it can be represented in Objective C
for the IPC layer
and confrom to NSSecureCoding for the IPC layer.
*/

private enum NSSecureCodingKeys {
static let oneTimeError = "oneTimeError"
static let operationErrors = "operationErrors"
}

public let oneTimeError: Error?
public let operationErrors: [Error]?

Expand All @@ -42,6 +47,22 @@ public class DataBrokerProtectionSchedulerErrorCollection: NSObject {
self.operationErrors = operationErrors
super.init()
}

// MARK: - NSSecureCoding

public static var supportsSecureCoding: Bool {
return true
}

public func encode(with coder: NSCoder) {
coder.encode(oneTimeError, forKey: NSSecureCodingKeys.oneTimeError)
coder.encode(operationErrors, forKey: NSSecureCodingKeys.operationErrors)
}

public required init?(coder: NSCoder) {
oneTimeError = coder.decodeObject(of: NSError.self, forKey: NSSecureCodingKeys.oneTimeError)
operationErrors = coder.decodeArrayOfObjects(ofClass: NSError.self, forKey: NSSecureCodingKeys.operationErrors)
}
}

public protocol DataBrokerProtectionScheduler {
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let package = Package(
.library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "133.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "134.0.0"),
.package(path: "../XPCHelper"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../LoginItems"),
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: "133.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "134.0.0"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down
Loading

0 comments on commit cb0bb65

Please sign in to comment.