-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Bugfix FXIOS-9830 Do not duplicate favicon URL and image requests on UITableViewCell reload [Favicon Refactor] #21587
Merged
ih-codes
merged 25 commits into
main
from
ih/FXIOS-9830-fix-duplicated-favicon-image-requests
Aug 29, 2024
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
773d10a
Update suggested top sites model and hard code favicon URLs.
ih-codes c1fb213
Remove code related to loading bundled favicons.
ih-codes ed573a8
Delete TopSites bundled favicon assets (1.2 MB save).
ih-codes 8647976
Use the faviconURL for the pinned Google site and DefaultSuggestedSit…
ih-codes dbbb81d
Make the Google pinned site have a hardcoded favicon URL to reduce la…
ih-codes 726c0ec
Refactor this try/catch to wrap the code it's related to, otherwise i…
ih-codes 902f5aa
Refactor as bundled asset step no longer needed in ImageHandler.
ih-codes 406533a
Refactoring GoogleTopSiteManager a bit.
ih-codes 2d17bd8
Delete tests and mocks using the removed DefaultBundleImageFetcher. U…
ih-codes b2b0699
Add some documentation for URL and Image requests paths.
ih-codes e467a27
Documentation update.
ih-codes bb173eb
Don't cache empty favicon URLs.
ih-codes 00a714d
swiftlint fixes
ih-codes 02056a7
Swiftlint fix.
ih-codes 967ab07
Typo fix.
ih-codes 308bc87
Swiftlint fix 2.
ih-codes f9ceed9
Revised fix for FXIOS-9427. Introduced dict for storing and awaiting …
ih-codes 2b0baae
swiflint fixes. Added documentation.
ih-codes 6a69dd9
Revert SiteImageHandler from actor to class. Add @MainActor annotatio…
ih-codes 027dfe0
Add unit test duplicating the multiple calls to getFaviconImage for t…
ih-codes 9aeadad
Add weak self to avoid retention on reallocations. Small test improve…
ih-codes 212eb84
Cleanup.
ih-codes d5043ee
swiftlint fixes.
ih-codes 872cb5b
Swiftlint fix 2.
ih-codes f70af63
Merge remote-tracking branch 'mozilla/main' into ih/FXIOS-9830-fix-du…
ih-codes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
BrowserKit/Sources/SiteImageView/ImageProcessing/BundleImageFetcher/BundleDataProvider.swift
This file was deleted.
Oops, something went wrong.
137 changes: 0 additions & 137 deletions
137
BrowserKit/Sources/SiteImageView/ImageProcessing/BundleImageFetcher/BundleImageFetcher.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think my only concern with this is the introduction of this global state; it's somewhat obscured that all of these instances will be potentially checking against the same shared request queue, even if they are initialized with different url handlers or image handlers. Right now I don't think that matters much in practice, and it's hard to imagine how it would realistically cause problems but it might be something nice for us to revisit at some point.
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 totally understand. Ideally this would all be refactored to be using a single instance of
DefaultSiteImageHandler
passed in to each cell, but this would entail a big refactor...I'm ok with leaving the current solution in as well, as long as we can get my new unit test to pass reliably for it. Since that (I believe) mimics the current state of affairs with multiple instances of DefaultSiteImageHandler being created for a single cell/site URL.
I'll experiment with it a bit this afternoon.
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 went back and forth on this a bunch when originally building it if this should be a singleton or not. In the end we opted to go with the simpler solution and live with the fact there would occasionally be the odd unnecessary request but obviously that has turned out to be a worse problem than we anticipated.
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'm not too worried about the global state from an app stability perspective because it's private and it's within a pretty contained submodule but it's a little concerning from a test perspective because of the possibility of one test colliding with another. It's not a major concern tho and seems like a reasonable solution that limits the scope of the change. Just worth keeping an eye on if we start getting flaky tests in this area in the future we might want to revisit.
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.
Thanks @OrlaM! That makes sense. This is definitely something to keep an eye on in the future... I was browsing Sentry to see if I could find any
EXC_BAD_ACCESS
type crashes related to favicons and saw this one. Made me wonder if it was something related to this recreation of theSiteImageHandler
.