Skip to content

Commit

Permalink
Merge branch 'release/0.29.0'
Browse files Browse the repository at this point in the history
* release/0.29.0: (27 commits)
  Fix the bookmark context menu Delete button.
  Set version to 0.29.0.
  Simplify app telemetry (#746)
  Add tabs divider line (#736)
  Update BSK reference for script execution guard (#750)
  Update autoconsent to 3.0.0. (#751)
  Bookmarks store structure fixes (#747)
  Update BSK pin (#745)
  Add user interface tooltips (#737)
  Bookmark reordering (#739)
  Update the bookmark import strategy, and import favicons (#708)
  remove deprecated error domain reference (#722)
  Use global TLD instance (#732)
  Bump BSK to update autofill to 5.1.0 (#743)
  Fix layout issue when opening links in the background (#735)
  Set useCapture in contextmenu listener to fix opening links on foxnews.com (#738)
  Shared DB handling for CoreData storage (#734)
  Revert "Version 0.28.10" - Add back the use of MARKETING_VERSION
  Update app version
  Update embedded files
  ...
  • Loading branch information
samsymons committed Oct 8, 2022
2 parents 7f10ff3 + 953a20e commit ba00e6f
Show file tree
Hide file tree
Showing 106 changed files with 3,801 additions and 1,348 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
name: Unit Tests

runs-on: macos-12
timeout-minutes: 30

steps:
- name: Register SSH keys for submodules access
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MARKETING_VERSION = 0.28.9
MARKETING_VERSION = 0.29.0

104 changes: 70 additions & 34 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,21 @@
ReferencedContainer = "container:DuckDuckGo.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "CBRCompileTimeReporterTests">
</Test>
<Test
Identifier = "EncryptionKeyStoreTests">
</Test>
<Test
Identifier = "PixelTests/testWhenErrorPixelIsFiredThenParametersAdded()">
</Test>
<Test
Identifier = "PixelTests/testWhenTimedPixelFiredThenCorrectDurationIsSet()">
</Test>
<Test
Identifier = "StatisticsLoaderTests/testWhenRefreshRetentionAtbIsPerformedForNavigationThenAppRetentionAtbRequested()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
Expand Down
37 changes: 16 additions & 21 deletions DuckDuckGo/App Delegate/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import BrowserServicesKit
@NSApplicationMain
final class AppDelegate: NSObject, NSApplicationDelegate {

let launchTimingPixel = TimedPixel(.launchTiming)

static var isRunningTests: Bool {
#if DEBUG
ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil
Expand Down Expand Up @@ -65,7 +63,20 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
Pixel.setUp()
#endif

Database.shared.loadStore()
Database.shared.loadStore { _, error in
guard let error = error else { return }

switch error {
case CoreDataDatabase.Error.containerLocationCouldNotBePrepared(let underlyingError):
Pixel.fire(.debug(event: .dbContainerInitializationError, error: underlyingError))
default:
Pixel.fire(.debug(event: .dbInitializationError, error: error))
}

// Give Pixel a chance to be sent, but not too long
Thread.sleep(forTimeInterval: 1)
fatalError("Could not load DB: \(error.localizedDescription)")
}
}

do {
Expand All @@ -90,7 +101,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
PrivacyFeatures.httpsUpgrade.loadDataAsync()
LocalBookmarkManager.shared.loadBookmarks()
FaviconManager.shared.loadFavicons()
_ = ConfigurationManager.shared
ConfigurationManager.shared.start()
_ = DownloadListCoordinator.shared
_ = RecentlyClosedCoordinator.shared

Expand All @@ -100,7 +111,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}

fireWaitlistLaunchPixel()
fireLaunchPixel(regularLaunch: (notification.userInfo?[NSApplication.launchIsDefaultUserInfoKey] as? NSNumber)?.boolValue)

stateRestorationManager.applicationDidFinishLaunching()

Expand All @@ -112,8 +122,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

applyPreferredTheme()

launchTimingPixel.fire()

appUsageActivityMonitor = AppUsageActivityMonitor(delegate: self)

crashReporter.checkForNewReports()
Expand Down Expand Up @@ -161,19 +169,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
appearancePreferences.updateUserInterfaceStyle()
}

private func fireLaunchPixel(regularLaunch: Bool?) {
if Pixel.Event.AppLaunch.repetition().value == .initial || regularLaunch ?? false {

Pixel.fire(.appLaunch(launch: .autoInitialOrRegular())) { error in
if let error = error, error is URLError {
os_log("appLaunch Pixel send failed: %s", type: .error, "\(error)")
} else {
Pixel.Event.AppLaunch.repetition().update()
}
}
}
}

private func fireWaitlistLaunchPixel() {
if Pixel.Event.AppLaunch.repetition().value == .initial && !Waitlist.isUnlocked {
Pixel.fire(.waitlistFirstLaunch)
Expand All @@ -190,7 +185,7 @@ extension AppDelegate: AppUsageActivityMonitorDelegate {
}

func activeUsageTimeHasReachedThreshold(avgTabCount: Double) {
Pixel.fire(.appActiveUsage(avgTabs: .init(avgTabs: avgTabCount)))
// This is temporarily unused while we determine whether it required to determine an active user count.
}

}
1 change: 0 additions & 1 deletion DuckDuckGo/App Delegate/URLEventHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ final class URLEventHandler {
self.handler(url)
}

Pixel.fire(.appLaunch(launch: urlsToOpen[0].isFileURL ? .openFile : .openURL))
self.urlsToOpen = []
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.824",
"green" : "0.824",
"red" : "0.824"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.267",
"green" : "0.267",
"red" : "0.267"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
2 changes: 1 addition & 1 deletion DuckDuckGo/Autoconsent/autoconsent-bundle.js

Large diffs are not rendered by default.

25 changes: 18 additions & 7 deletions DuckDuckGo/Autofill/ContentOverlayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,25 @@ public final class ContentOverlayViewController: NSViewController, EmailManagerR

public func emailManagerKeychainAccessFailed(accessType: EmailKeychainAccessType, error: EmailKeychainAccessError) {
var parameters = [
"access_type": accessType.rawValue,
"error": error.errorDescription
]

if case let .keychainAccessFailure(status) = error {
parameters["keychain_status"] = String(status)
}
"access_type": accessType.rawValue,
"error": error.errorDescription
]

if case let .keychainLookupFailure(status) = error {
parameters["keychain_status"] = String(status)
parameters["keychain_operation"] = "lookup"
}

if case let .keychainDeleteFailure(status) = error {
parameters["keychain_status"] = String(status)
parameters["keychain_operation"] = "delete"
}

if case let .keychainSaveFailure(status) = error {
parameters["keychain_status"] = String(status)
parameters["keychain_operation"] = "save"
}

Pixel.fire(.debug(event: .emailAutofillKeychainError), withAdditionalParameters: parameters)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ extension BookmarksBarViewController: BookmarksBarViewModelDelegate {
addBookmarkViewController.edit(bookmark: bookmark)
presentAsModalWindow(addBookmarkViewController)
case .moveToEnd:
bookmarkManager.move(objectUUID: bookmark.id, toIndex: nil) { _ in }
bookmarkManager.move(objectUUIDs: [bookmark.id], toIndex: nil, withinParentFolder: .root) { _ in }
case .copyURL:
NSPasteboard.general.copy(url: bookmark.url)
case .deleteEntity:
Expand All @@ -242,7 +242,7 @@ extension BookmarksBarViewController: BookmarksBarViewModelDelegate {
addFolderViewController.edit(folder: folder)
presentAsModalWindow(addFolderViewController)
case .moveToEnd:
bookmarkManager.move(objectUUID: folder.id, toIndex: nil) { _ in }
bookmarkManager.move(objectUUIDs: [folder.id], toIndex: nil, withinParentFolder: .root) { _ in }
case .deleteEntity:
bookmarkManager.remove(folder: folder)
default:
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/Bookmarks Bar/View/BookmarksBarViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ extension BookmarksBarViewModel: NSCollectionViewDelegate, NSCollectionViewDataS
collectionView.animator().moveItem(at: existingIndexPath, to: IndexPath(item: index, section: 0))
existingItemDraggingIndexPath = nil

bookmarkManager.move(objectUUID: entityUUID, toIndex: index, withinParentFolder: .root) { error in
bookmarkManager.move(objectUUIDs: [entityUUID], toIndex: newIndexPath.item, withinParentFolder: .root) { error in
if error != nil {
self.delegate?.bookmarksBarViewModelReloadedData()
}
Expand All @@ -403,7 +403,7 @@ extension BookmarksBarViewModel: NSCollectionViewDelegate, NSCollectionViewDataS

for item in pasteboardItems {
if let bookmarkEntityUUID = item.bookmarkEntityUUID {
bookmarkManager.move(objectUUID: bookmarkEntityUUID, toIndex: currentIndexPathItem, withinParentFolder: .root) { error in
bookmarkManager.move(objectUUIDs: [bookmarkEntityUUID], toIndex: currentIndexPathItem, withinParentFolder: .root) { error in
if error != nil {
self.delegate?.bookmarksBarViewModelReloadedData()
}
Expand Down
Loading

0 comments on commit ba00e6f

Please sign in to comment.