Skip to content

Commit

Permalink
Always use 'sandbox' Application Support directory for Favicons Fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Jan 3, 2024
1 parent 3e020ba commit fcf3bf1
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions DuckDuckGo/Sync/SyncBookmarksAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@ public class BookmarksFaviconsFetcherErrorHandler: EventMapping<BookmarksFavicon
}
}

enum SyncBookmarksAdapterError: CustomNSError {
case unableToAccessFaviconsFetcherStateStoreDirectory

static let errorDomain: String = "SyncBookmarksAdapterError"

var errorCode: Int {
switch self {
case .unableToAccessFaviconsFetcherStateStoreDirectory:
return 1
}
}
}

final class SyncBookmarksAdapter {

private(set) var provider: BookmarksProvider?
Expand Down Expand Up @@ -157,10 +144,7 @@ final class SyncBookmarksAdapter {
private func setUpFaviconsFetcher() -> BookmarksFaviconsFetcher? {
let stateStore: BookmarksFaviconsFetcherStateStore
do {
guard let url = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first else {
throw SyncBookmarksAdapterError.unableToAccessFaviconsFetcherStateStoreDirectory
}
stateStore = try BookmarksFaviconsFetcherStateStore(applicationSupportURL: url)
stateStore = try BookmarksFaviconsFetcherStateStore(applicationSupportURL: URL.sandboxApplicationSupportURL)
} catch {
Pixel.fire(.debug(event: .bookmarksFaviconsFetcherStateStoreInitializationFailed, error: error))
os_log(.error, log: OSLog.sync, "Failed to initialize BookmarksFaviconsFetcherStateStore: %{public}s", String(reflecting: error))
Expand Down

0 comments on commit fcf3bf1

Please sign in to comment.