-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow automated fetching of synced bookmarks' favicons #2163
Conversation
…ontroller being presented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good.
the SyncSettingsVC and the UI part are changed in the new UI… that will be a bit messy
Core/SyncBookmarksAdapter.swift
Outdated
private func setUpFaviconsFetcher() -> BookmarksFaviconsFetcher? { | ||
let stateStore: BookmarksFaviconsFetcherStateStore | ||
do { | ||
let url = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why no guard let?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already rely on ~/Library/Application Support
directory to be present and accessible on users' devices (you'll find the same force-unwrapped call in URLExtension
). I can add a guard let here though and report another error here, no problem 👍
@@ -118,6 +121,9 @@ struct UserText { | |||
static let bookmarksLimitExceededAction = "Manage Bookmarks" | |||
static let credentialsLimitExceededAction = "Manage Logins" | |||
|
|||
static let fetchFaviconsOnboardingTitle = "Download Missing Icons?" | |||
static let fetchFaviconsOnboardingMessage = "Do you want this device to automatically download icons for any new bookmarks synced from your other devices? This will expose the download to your network any time a bookmark is synced." | |||
static let fetchFaviconsOnboardingButtonTitle = "Keep Bookmarks Icons Updated" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to use Localised strings. In case you can update them
# By Dominik Kapusta (1) and others # Via GitHub * develop: moving the toggle to the top of the dashboard (#2166) Allow automated fetching of synced bookmarks' favicons (#2163) NetP Geoswitching Design Review feedback (#2206) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
* develop: (40 commits) Address Bar Spoofing Tests + Remediation (#2181) Update Sync e2e tests to fit the new UI (#2215) NetP waitlist final touches (#2209) NetP: Remove port from server address (#2214) NetP: Fix list row colours (#2213) Reset VPN waitlist T&C (#2212) Report macOS active/new user for netP (#2207) Sabrina/sync setup update (#2198) new pixels for toolbars and share sheet (#2208) Use design system fonts throughout NetP (#2211) moving the toggle to the top of the dashboard (#2166) Allow automated fetching of synced bookmarks' favicons (#2163) NetP Geoswitching Design Review feedback (#2206) update theme to use system colours (#2180) Release 7.99.0 (#2205) Update iOS privacy defaults (#2185) Remove disabled switches from VPN Settings screen (#2203) Update BSK for VPN settings (#2165) Fix migrating from Bookmarks V2 and older (#2196) Autofill pixel parameter removed (#2182) ...
Task/Issue URL: https://app.asana.com/0/0/1205949780297088/f
Tech Design URL: https://app.asana.com/0/481882893211075/1204986998781220/f
Description:
Add BookmarksFaviconFetcher that is used to fetch favicons for bookmarks received by Sync.
Fetcher is opt-in, controlled by a setting inside Sync settings (with an additional in-context onboarding
popup presented from client apps). Fetcher uses LinkPresentation framework to obtain a favicon
for a given domain, and in case of failure it falls back to checking hardcoded favicon URLs.
Fetcher keeps a state internally, by saving list of bookmarks IDs that need processing to a file on disk.
Fetcher plugs into clients' implementation of favicon storage by exposing FaviconStoring protocol.
Fetcher performs fetching on a serial operation queue. Each fetcher invocation cancels previously scheduled
operation and schedules a new one. Updating fetcher state is also scheduled on the operation queue -
state updates don't support cancelling and always finish before next operation is started.
Steps to test this PR:
See BSK PR for testing steps.
Copy Testing:
’
rather than'
Orientation Testing:
Device Testing:
OS Testing:
Theme Testing:
Internal references:
Software Engineering Expectations
Technical Design Template