Skip to content

Commit

Permalink
Merge branch 'main' into dominik/xcode-16
Browse files Browse the repository at this point in the history
* main:
  Update C-S-S to 6.29.0 (#1062)
  Send pixel on sync secure storage read failure (#1058)
  • Loading branch information
samsymons committed Nov 5, 2024
2 parents 3160ecf + 64a5d8d commit 9a8a9e0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "48fee2508995d4ac02d18b3d55424adedcb4ce4f",
"version" : "6.28.0"
"revision" : "6cab7bdb584653a5dc007cc1ae827ec41c5a91bc",
"version" : "6.29.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let package = Package(
.package(url: "https://github.com/duckduckgo/sync_crypto", exact: "0.3.0"),
.package(url: "https://github.com/gumob/PunycodeSwift.git", exact: "3.0.0"),
.package(url: "https://github.com/duckduckgo/privacy-dashboard", exact: "7.1.1"),
.package(url: "https://github.com/duckduckgo/content-scope-scripts", exact: "6.28.0"),
.package(url: "https://github.com/duckduckgo/content-scope-scripts", exact: "6.29.0"),
.package(url: "https://github.com/httpswift/swifter.git", exact: "1.5.0"),
.package(url: "https://github.com/duckduckgo/bloom_cpp.git", exact: "3.0.0"),
.package(url: "https://github.com/1024jp/GzipSwift.git", exact: "6.0.1")
Expand Down
9 changes: 8 additions & 1 deletion Sources/DDGSync/DDGSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ public class DDGSync: DDGSyncing {
}

public var account: SyncAccount? {
try? dependencies.secureStore.account()
do {
return try dependencies.secureStore.account()
} catch {
if let syncError = error as? SyncError {
dependencies.errorEvents.fire(syncError, error: syncError)
}
return nil
}
}

public var scheduler: Scheduling {
Expand Down
10 changes: 10 additions & 0 deletions Sources/DDGSync/SyncError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,14 @@ extension SyncError: CustomNSError {
}
}

public var errorUserInfo: [String: Any] {
switch self {
case .failedToReadSecureStore(let status), .failedToWriteSecureStore(let status), .failedToRemoveSecureStore(let status):
let underlyingError = NSError(domain: "secError", code: Int(status))
return [NSUnderlyingErrorKey: underlyingError]
default:
return [:]
}
}

}

0 comments on commit 9a8a9e0

Please sign in to comment.