Closed Bug 1196809 Opened 9 years ago Closed 9 years ago

Pick best available icon for pinned sites on homescreen

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect, P2)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED
FxOS-S9 (16Oct)

People

(Reporter: benfrancis, Assigned: gmarty)

References

Details

(Whiteboard: [systemsfe][p=3])

Attachments

(2 files, 1 obsolete file)

Currently bookmarks use the .icon property of an object stored in the bookmarks DataStore which is set to a single icon when the bookmark is saved. In bug 1168960 we are saving pinned sites in the bookmarks DataStore using a siteObject which may include multiple .icons specified in <link rel=icon> tags and also .webManifest metadata if provided by the site, which may also specify multiple icons of different sizes. Instead of using the .icon property, the (new) homescreen should use the IconsHelper to extract, fetch and cache the best available icon from the site object for the size required at runtime. It may need to fall back to the .icon property for existing bookmarks if no migration is carried out.
Assignee: nobody → gmarty
I've started working on it. The very early work in progress is in this branch: https://github.com/gmarty/gaia/tree/Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen
Whiteboard: [systemsfe] → [systemsfe][p=3]
The patch is looking good but now the homescreen crashes whenever a bookmark is opened (repro 100% of the time). Chris, it's very likely to be a Gecko bug, can you help me debugging this? I need to decrypt the logcat.
Flags: needinfo?(chrislord.net)
(In reply to Guillaume Marty [:gmarty] from comment #2) > The patch is looking good but now the homescreen crashes whenever a bookmark > is opened (repro 100% of the time). > Chris, it's very likely to be a Gecko bug, can you help me debugging this? I > need to decrypt the logcat. Are you running a debug build ? If so, then the leak in bug 1202592 on debug build will produce this kind of crash. It should be explicit when looking at logcat.
Flags: needinfo?(gmarty)
That's a regular build but the logcat show these lines: I/Gecko ( 318): -*- SettingsManager: WARNING: MORE THAN 10 OBSERVERS FOR dev.gaia.pinning_the_web: 23 FROMaddObserver@jar:file:///system/b2g/omni.ja!/components/SettingsManager.js:382:48 I/Gecko ( 318): sl_observe@app://system.gaiamobile.org/shared/js/settings_listener.js:58:5 I/Gecko ( 318): BrowserContextMenu@app://system.gaiamobile.org/js/browser_context_menu.js:21:1 ... I/Gecko ( 318): -*- SettingsManager: WARNING: MORE THAN 10 OBSERVERS FOR dev.gaia.pinning_the_web: 24 FROMaddObserver@jar:file:///system/b2g/omni.ja!/components/SettingsManager.js:382:48 I/Gecko ( 318): sl_observe@app://system.gaiamobile.org/shared/js/settings_listener.js:58:5 I/Gecko ( 318): ac__registerEvents@app://system.gaiamobile.org/js/app_chrome.js:608:7 And there's no way there are more than 2 of these observers when on startup there only a couple instances of appChrome objects. Also commenting out the lines using SettingsListener prevents the crash. So there's definitely an issue here.
Flags: needinfo?(gmarty)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master I can't reproduce the crash in the latest master, so it's ready to review.
Attachment #8662956 - Flags: review?(chrislord.net)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master I've added comments on github - there are outstanding issues/questions before I can r+ this.
Flags: needinfo?(chrislord.net)
Attachment #8662956 - Flags: review?(chrislord.net)
(In reply to Guillaume Marty [:gmarty] from comment #2) > The patch is looking good but now the homescreen crashes whenever a bookmark > is opened (repro 100% of the time). > Chris, it's very likely to be a Gecko bug, can you help me debugging this? I > need to decrypt the logcat. I am wondering if you are not just seeing another instance of bug 1206485. Attaching a gdb might help.
Flags: needinfo?(gmarty)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master I reworked the logic as discussed with Alberto. Before going deeper in refining the code and writing test, can you take a look to see if the patch is going in the right direction?
Flags: needinfo?(gmarty)
Attachment #8662956 - Flags: feedback?(chrislord.net)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master This looks good to me - left a couple of comments, but likely just over WIP stuff.
Attachment #8662956 - Flags: feedback?(chrislord.net) → feedback+
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master Chris, how does it look like now?
Attachment #8662956 - Flags: review?(chrislord.net)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master I think this is mostly ok, but: - This doesn't actually switch over homescreen from using gaia-app-icon in its bower_components to gaia-site-icon? - If the former is done, the icon-loaded handler will need to be modified so that it doesn't cache icons that we just set (because Alberto changed gaia-site-icon so that icon-loaded is always fired, even when the icon is user-set) - We also need to not cache bookmark icons I guess, if they're cached by IconsHelper?
Attachment #8662956 - Flags: review?(chrislord.net)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master Ready for another round of review. I made the changes you pointed and reworked the dependencies to avoid useless duplication with /shared/elements.
Attachment #8662956 - Flags: review?(chrislord.net)
Comment on attachment 8662956 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen > mozilla-b2g:master One nit, but lgtm :) Re-flag me if there are failing tests that you need to make significant changes to get to pass.
Attachment #8662956 - Flags: review?(chrislord.net) → review+
Keywords: checkin-needed
Priority: -- → P2
seems there are merge conflicts, could you take a look, thanks!
Flags: needinfo?(gmarty)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment on attachment 8671825 [details] [review] [gaia] gmarty:Bug-1196809-Pick-best-available-icon-for-pinned-sites-on-homescreen-new > mozilla-b2g:master Carrying r+ from Chris.
Flags: needinfo?(gmarty)
Attachment #8671825 - Flags: review+
I double checked and the tests are green on treeherder. Also the failing Gij test passes locally.
Keywords: checkin-needed
Attachment #8662956 - Attachment is obsolete: true
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S9 (16Oct)
Attachment #8673101 - Flags: review?(chrislord.net)
Attachment #8673101 - Flags: review?(chrislord.net) → review+
Flags: needinfo?(gmarty)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: