Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into autofill/anya-logins-…
Browse files Browse the repository at this point in the history
…to-passwords
  • Loading branch information
amddg44 committed Dec 7, 2023
2 parents ad5f44c + 3fa0135 commit a099432
Show file tree
Hide file tree
Showing 59 changed files with 836 additions and 164 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Checks

on:
push:
branches: [ develop, "release/**" ]
branches: [ main, "release/**" ]
pull_request:


Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
retention-days: 7

- name: Fetch latest commit author
if: always() && github.ref_name == 'develop'
if: always() && github.ref_name == 'main'
id: fetch_commit_author
env:
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -353,7 +353,7 @@ jobs:
name: Create Asana Task
needs: [swiftlint, tests, release-build, verify-autoconsent-bundle, private-api]

if: failure() && github.ref_name == 'develop' && github.run_attempt == 1
if: failure() && github.ref_name == 'main' && github.run_attempt == 1

runs-on: ubuntu-latest

Expand All @@ -370,7 +370,7 @@ jobs:
name: Close Asana Task
needs: [swiftlint, tests, release-build, verify-autoconsent-bundle, private-api]

if: success() && github.ref_name == 'develop' && github.run_attempt > 1
if: success() && github.ref_name == 'main' && github.run_attempt > 1

runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We're always open to contributions from the community! There are different appro
* If you're looking for a bug to work on, see the [Help Wanted](https://github.com/duckduckgo/macOS/issues?q=is%3Aissue+is%3Aopen+label%3A%22Help+Wanted%22) tag for a list of open issues.

### Style Guide
We care about clean code. Refer to our [style guide](https://github.com/duckduckgo/iOS/blob/develop/styleguide/STYLEGUIDE.md).
We care about clean code. Refer to our [style guide](https://github.com/duckduckgo/iOS/blob/main/styleguide/STYLEGUIDE.md).

### Commit Messages
See Chris Beams' guide to writing good commit messages https://chris.beams.io/posts/git-commit/
2 changes: 1 addition & 1 deletion Configuration/AppStoreBuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 86
CURRENT_PROJECT_VERSION = 89
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.66.0
MARKETING_VERSION = 1.67.0
10 changes: 9 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,7 @@
9D9AE9312AAB8A9E0026E7DC /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = 9D9AE9302AAB8A9E0026E7DC /* BrowserServicesKit */; };
9DB6E7242AA0DC5800A17F3C /* LoginItems in Frameworks */ = {isa = PBXBuildFile; productRef = 9DB6E7232AA0DC5800A17F3C /* LoginItems */; };
9DC70B1A2AA1FA5B005A844B /* LoginItems in Frameworks */ = {isa = PBXBuildFile; productRef = 9DC70B192AA1FA5B005A844B /* LoginItems */; };
9DEF97E12B06C4EE00764F03 /* Networking in Frameworks */ = {isa = PBXBuildFile; productRef = 9DEF97E02B06C4EE00764F03 /* Networking */; };
AA06B6B72672AF8100F541C5 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = AA06B6B62672AF8100F541C5 /* Sparkle */; };
AA0877B826D5160D00B05660 /* SafariVersionReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0877B726D5160D00B05660 /* SafariVersionReaderTests.swift */; };
AA0877BA26D5161D00B05660 /* WebKitVersionProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0877B926D5161D00B05660 /* WebKitVersionProviderTests.swift */; };
Expand Down Expand Up @@ -4371,6 +4372,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9DEF97E12B06C4EE00764F03 /* Networking in Frameworks */,
9D6983F92AC773C3002C02FC /* PixelKit in Frameworks */,
9D9AE8F92AAA3AD00026E7DC /* DataBrokerProtection in Frameworks */,
);
Expand Down Expand Up @@ -8202,6 +8204,7 @@
packageProductDependencies = (
9D9AE8F82AAA3AD00026E7DC /* DataBrokerProtection */,
9D6983F82AC773C3002C02FC /* PixelKit */,
9DEF97E02B06C4EE00764F03 /* Networking */,
);
productName = DuckDuckGoAgent;
productReference = 9D9AE8D12AAA39A70026E7DC /* DuckDuckGoDBPBackgroundAgent.app */;
Expand Down Expand Up @@ -12749,7 +12752,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 87.2.0;
version = 92.0.3;
};
};
AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down Expand Up @@ -13194,6 +13197,11 @@
isa = XCSwiftPackageProductDependency;
productName = LoginItems;
};
9DEF97E02B06C4EE00764F03 /* Networking */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Networking;
};
AA06B6B62672AF8100F541C5 /* Sparkle */ = {
isa = XCSwiftPackageProductDependency;
package = AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "8e77b5a057d6f941a16218b27289554b60d44772",
"version" : "87.2.0"
"revision" : "5ca0b3d915ab73de43744db40edf41c1d5060034",
"version" : "92.0.3"
}
},
{
Expand Down Expand Up @@ -77,8 +77,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"revision" : "daa9708223b4b4318fb6448ca44801dfabcddc6f",
"version" : "3.0.0"
"revision" : "38336a574e13090764ba09a6b877d15ee514e371",
"version" : "3.1.1"
}
},
{
Expand All @@ -104,8 +104,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "6b2aa2748a7881eebb9f84fb10c01293e15b52ca",
"version" : "0.5.0"
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
}
},
{
Expand All @@ -129,10 +129,10 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"state" : {
"revision" : "4684440d03304e7638a2c8086895367e90987463",
"version" : "1.2.1"
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
}
},
{
Expand Down
30 changes: 27 additions & 3 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel
private(set) var syncService: DDGSyncing?
private var syncStateCancellable: AnyCancellable?
private var bookmarksSyncErrorCancellable: AnyCancellable?
private var screenLockedCancellable: AnyCancellable?
private var emailCancellables = Set<AnyCancellable>()
let bookmarksManager = LocalBookmarkManager.shared

Expand Down Expand Up @@ -339,9 +340,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel
let environment = defaultEnvironment
#endif
let syncDataProviders = SyncDataProviders(bookmarksDatabase: BookmarkDatabase.shared.db)
if bookmarksManager.didMigrateToFormFactorSpecificFavorites {
syncDataProviders.bookmarksAdapter.shouldResetBookmarksSyncTimestamp = true
}
let syncService = DDGSync(dataProvidersSource: syncDataProviders, errorEvents: SyncErrorHandler(), log: OSLog.sync, environment: environment)
syncService.initializeIfNeeded()
syncDataProviders.setUpDatabaseCleaners(syncService: syncService)
Expand All @@ -355,6 +353,32 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel

self.syncDataProviders = syncDataProviders
self.syncService = syncService

subscribeSyncQueueToScreenLockedNotifications()
}

private func subscribeSyncQueueToScreenLockedNotifications() {
let screenIsLockedPublisher = DistributedNotificationCenter.default
.publisher(for: .init(rawValue: "com.apple.screenIsLocked"))
.map { _ in true }
let screenIsUnlockedPublisher = DistributedNotificationCenter.default
.publisher(for: .init(rawValue: "com.apple.screenIsUnlocked"))
.map { _ in false }

screenLockedCancellable = Publishers.Merge(screenIsLockedPublisher, screenIsUnlockedPublisher)
.receive(on: DispatchQueue.main)
.sink { [weak self] isLocked in
guard let syncService = self?.syncService, syncService.authState != .inactive else {
return
}
if isLocked {
os_log(.debug, log: .sync, "Screen is locked")
syncService.scheduler.cancelSyncAndSuspendSyncQueue()
} else {
os_log(.debug, log: .sync, "Screen is unlocked")
syncService.scheduler.resumeSyncQueue()
}
}
}

private func subscribeToEmailProtectionStatusNotifications() {
Expand Down
5 changes: 0 additions & 5 deletions DuckDuckGo/Bookmarks/Model/BookmarkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protocol BookmarkManager: AnyObject {
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult

func handleFavoritesAfterDisablingSync()
var didMigrateToFormFactorSpecificFavorites: Bool { get }

// Wrapper definition in a protocol is not supported yet
var listPublisher: Published<BookmarkList?>.Publisher { get }
Expand Down Expand Up @@ -82,10 +81,6 @@ final class LocalBookmarkManager: BookmarkManager {
@Published private(set) var list: BookmarkList?
var listPublisher: Published<BookmarkList?>.Publisher { $list }

var didMigrateToFormFactorSpecificFavorites: Bool {
bookmarkStore.didMigrateToFormFactorSpecificFavorites
}

private lazy var bookmarkStore: BookmarkStore = LocalBookmarkStore(bookmarkDatabase: BookmarkDatabase.shared)
private lazy var faviconManagement: FaviconManagement = FaviconManager.shared

Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/Bookmarks/Services/BookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ protocol BookmarkStore {
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult

func handleFavoritesAfterDisablingSync()
var didMigrateToFormFactorSpecificFavorites: Bool { get }
}
1 change: 0 additions & 1 deletion DuckDuckGo/Bookmarks/Services/LocalBookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ final class LocalBookmarkStore: BookmarkStore {

if context.hasChanges {
try context.save(onErrorFire: .bookmarksMigrationCouldNotPrepareMultipleFavoriteFolders)
didMigrateToFormFactorSpecificFavorites = true
}
} catch {
Thread.sleep(forTimeInterval: 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ extension UserText {

// MARK: - Navigation Bar Status View

static let networkProtectionNavBarStatusViewShareFeedback = NSLocalizedString("network.protection.navbar.status.view.share.feedback", value: "Share Feedback...", comment: "Menu item for 'Share Feedback' in the Network Protection status view that's shown in the navigation bar")
static let networkProtectionNavBarStatusMenuVPNSettings = NSLocalizedString("network.protection.status.menu.vpn.settings", value: "VPN Settings...", comment: "The status menu 'VPN Settings' menu item")
static let networkProtectionNavBarStatusViewShareFeedback = NSLocalizedString("network.protection.navbar.status.view.share.feedback", value: "Share Feedback", comment: "Menu item for 'Share Feedback' in the Network Protection status view that's shown in the navigation bar")
static let networkProtectionNavBarStatusMenuVPNSettings = NSLocalizedString("network.protection.status.menu.vpn.settings", value: "VPN Settings", comment: "The status menu 'VPN Settings' menu item")

// MARK: - System Extension Installation Messages

Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public struct UserDefaultsWrapper<T> {
case syncIsFaviconsFetcherEnabled = "sync.is-favicons-fetcher-enabled"
case syncIsEligibleForFaviconsFetcherOnboarding = "sync.is-eligible-for-favicons-fetcher-onboarding"
case syncDidPresentFaviconsFetcherOnboarding = "sync.did-present-favicons-fetcher-onboarding"
case syncDidMigrateToImprovedListsHandling = "sync.did-migrate-to-improved-lists-handling"
}

enum RemovedKeys: String, CaseIterable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import BrowserServicesKit
final class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"585f88ce034f4d97de6a1f9c3bb1277c\""
public static let embeddedDataSHA = "9a9e452002b3306ec7a351ec6fcc167278389434c47dd72abd17ad030f431be5"
public static let embeddedDataETag = "\"90ccd893668d6bc8f7425c54fa5c20f7\""
public static let embeddedDataSHA = "0ad89dd3376c075e5897521b7c197d1e99df43fcad6d77061bc7629ee9d6a6e2"
}

var embeddedDataEtag: String {
Expand Down
Loading

0 comments on commit a099432

Please sign in to comment.