Closed Bug 1250391 Opened 7 years ago Closed 7 years ago

[Sync] tabs record doesn't include the page favicon.


(Firefox for Android Graveyard :: Android Sync, defect)

Not set


(firefox48 fixed)

Firefox 48
Tracking Status
firefox48 --- fixed


(Reporter: markh, Assigned: markh, Mentored)


(Whiteboard: [lang=java][good next bug])


(1 file)

The tabs record has the ability to store the favicon URL for a tab in an "icon" field. Desktop sets this via

It would be great if Android also populated this field, so that when a user access Synced Tabs for a page that doesn't already have a favicon populated locally, a sane favicon is still able to be used.

Nick, is this viable and relatively simple?
Flags: needinfo?(nalexander)
Yeah, we can do this.  rnewman may even dupe this :)

It looks like we already have this handled in -- I see the DB reads and writes.

That means there's likely an issue populating the field in the DB.  I'll keep the NI to investigate one step further.  It may be that we should be fetching up-to-date favicons from our favicon service instead of using the DB field.
Mentor: nalexander
Whiteboard: [lang=java][good next bug]
Component: General → Android Sync
Flags: needinfo?(nalexander)
Product: Firefox for Android → Android Background Services
My experiments have shown that on loading a tab:

* Tab::addFavicon ( is called with the favicon url - this sticks the url in mAvailableFavicons.
* LocalTabsAccessor::insertLocalTabs ( asks the tab for its favicon - it gets null as mFaviconUrl is still null.
* Tab::loadFavicon is then asked to load the favicon - it loads successfully, sets mFaviconUrl then does |Tabs.getInstance().notifyListeners(Tab.this, Tabs.TabEvents.FAVICON);|
* LocalTabsAccessor doesn't again attempt to request the favicon after the tab loads.

ISTM should possibly have a listener for the FAVICON event, but I wouldn't be surprised to hear it's not that simple ;) Nick, can you offer any advice on what should be happening here but isn't?
Flags: needinfo?(nalexander)
Attached patch t.patchSplinter Review already has a listener for these events, but it doesn't do anything on the FAVICON notification. This (probably naive) patch adds a listener and queues the persisting of tabs when it fires. My Log() debugging tells me that this works - that after getting the notification the LocalTabsAccessor attempts to fetch the favicon and gets one.

Nick, does this seem like the correct approach?
Flags: needinfo?(nalexander)
Attachment #8727201 - Flags: feedback?(nalexander)
Comment on attachment 8727201 [details] [diff] [review]

Review of attachment 8727201 [details] [diff] [review]:

I think this is sensible.  Push a try build, Robocop everything -- and accept my thanks for digging into the Fennec code :)
Attachment #8727201 - Flags: feedback?(nalexander) → review+
Thanks - my first Android patch \o/
Assignee: nobody → markh
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.