Part 2 - Replace SDWebImage with Kingfisher to stop Firefox from crashing when opening some PDF which causes memory pressure
This is Part 2 of the replacement ticket:
- Add operation to clear SD WebImage cache and add Glean report so we are able to track its progress and eventually remove the library in the next few releases
- Add mechanism to limit kingfisher cache to a certain percentage of the device memory otherwise, the disk cache can easily become bloated - This is already done by KF, and by default the mem cache is 25% of the total memory and the disk cache gets cleared after 7 days: https://github.com/onevcat/Kingfisher/wiki/New-In-Kingfisher-5
Steps to reproduce
Opening the link to this PDF crashes Firefox: https://www.makochicago.com/s/20220421-Mako-Menu.pdf
Reference Tickets and PRs:
Part 1: https://mozilla-hub.atlassian.net/browse/FXIOS-4285
Part 2: https://mozilla-hub.atlassian.net/browse/FXIOS-4321
Part 3: https://mozilla-hub.atlassian.net/browse/FXIOS-4533
Part 4: https://mozilla-hub.atlassian.net/browse/FXIOS-4532
Expected behavior
PDF loads.
Actual behavior
Firefox crashes to home screen after 1-2 seconds.
Device & build information
- Device: iPhone 11 max pro /iOS 15.4.1
- Build version: FF Daylight 101.1 (9384)
*# *## Notes Attachments:
┆Issue is synchronized with this Jira Task
➤ Nishant Bhasin commented:
Made a PR related to some of the work along with two more tickets for Part 3 and Part 4 so we can do the work in a more organized manner.
In the PR below we added SDWebImage clear disk cache on background and add counter for tracking KF migration
https://github.com/mozilla-mobile/firefox-ios/pull/11169 ( https://github.com/mozilla-mobile/firefox-ios/pull/11169|smart-link )
➤ Simion Basca commented:
Nishant Bhasin should we start testing this or should we wait for all the work (3 and 4) to be finished to start testing?
➤ Nishant Bhasin commented:
Simion Basca you can start testing this as of v103.0
The work 3) and 4) and to add tests etc
➤ Catalin Suciu commented:
Tested this on latest main and didn’t experienced any regressions. Verifying the issue as fixed.