Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #3071: Load favicons on background thread, fix cell reusing. #3090

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

iccub
Copy link
Contributor

@iccub iccub commented Nov 27, 2020

Summary of Changes

This pull request fixes #3071

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()

Test Plan:

Import large amount of bookmarks, can use file from here #3070
Scroll through bookmarks, see if there is a lag

This also fixed a bug where sometimes folder had backgrounds colors or favicons were incorrect

Screenshots:

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • release-notes/(include|exclude)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue is assigned to a milestone (should happen at merge time).

@iccub iccub requested a review from kylehickinson November 27, 2020 18:43
})

if let task = loadTaskCancellable {
DispatchQueue.global(qos: .utility).async(execute: task)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utility is a low priority task, something like seeing an icon may need to be bumped up to userInitiated. This also may spawn a lot of queue's on the global queue at once, are we sure we don't want to use a private NSOperationQueue instead?

Comment on lines 298 to 303
if !shouldReuse {
return
}

cell.imageView?.cancelFaviconLoad()
cell.backgroundColor = .clear
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Some sort of mismatch in spacing here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this class has a mix of 2 and 4 space format, once you approve this PR i will reformat it, don't want to add noise to the PR until then

@iccub iccub requested a review from kylehickinson November 30, 2020 15:24
@iccub iccub merged commit ad66c99 into development Nov 30, 2020
@iccub iccub deleted the bugfix/3071 branch November 30, 2020 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve bookmark scrolling when there is an insane amount of bookmarks
2 participants