Closed Bug 1374800 Opened 7 years ago Closed 7 years ago

Favicons Flickering in UI with the Activity Stream Test Pilot

Categories

(Firefox :: Bookmarks & History, defect, P3)

defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox56 --- affected

People

(Reporter: shorlander, Unassigned)

References

Details

(Whiteboard: [fxsearch])

Attachments

(2 files)

Not really sure what's causing this but I have some favicons on the Bookmarks Toolbar, Sidebar or in the Library window start rapidly flickering.

The Pocket favicon from https://getpocket.com/a/queue/list/ does it reliably.

On an original model Retina MacBook Pro and a newer Retina MacBook. Does not appear to happen on Windows.
Screen recording of flickering
Also of note and possibly relevant:

The favicon in the tab is different than the favicon in the Bookmarks Toolbar.
Flags: needinfo?(mak77)
Does the page reload constantly (could probably be verified through the network dev tool)? We have a bug where on a new visit we clear and repaint the icon, I wonder if it's the case that this page just reloads continuously and we try to seticon at every reload!?
Though, I'd not be sure why this would only be an issue on Mac, we set the attribute in the same exact way on all the platforms, maybe it's just a different way of painting in imagelib, not sure.

I don't have a Pocket account, I may have to create one to test this.

The tab icon is unrelated to the icon in the bookmarks view, they may be the same, but it's not mandatory atm, that's because one of the 2 may have a better resolution than the other one and for now we pick the best resolution (some of the follow-up work may improve this). Also if the flickering happens in the tab rather than in bookmarks view, it could also be a completely different problem, since they are independent as of now.
Priority: -- → P1
Whiteboard: [fxsearch]
Ah, but I DO have a Firefox Account :)
(In reply to Virtual_ManPL [:Virtual] - (please needinfo? me - so I will see your comment/reply/question/etc.) from comment #5)
> could be dupe of bug #1360158

Some users noticed flickering on tabs, and that can't be related to bug 1360158.
And we still need to confirm whether the page is reloading so often (and why), locally on Windows I don't see any reload. I must check on Mac.
I see this flickering bookmark icon for my Pinboard bookmark (https://pinboard.in/u:$USERNAME/unread/) on Mac and Windows. I can't reproduce in a clean profile, even after logging into Pinboard, but I can repro the problem in earlier versions of Firefox using the same profile.

After launching Firefox, the bookmark icon does not start flickering until I visit the Pinboard site. I then see an endless stream of errors in the browser console (Ctrl+Shift+J) for script URLs from the Pinboard page, even after I close the Pinboard tab:

‘src’ attribute of <script> element is not a valid URI: “/app.ea9aec.js”  {6a4abc99-03bf-43ea-925e-eb52f083690c}:1
‘src’ attribute of <script> element is not a valid URI: “/js/shortcuts.js”  {d3d8e0ac-95df-44d3-ae73-7e7dfd5d5eec}:1
‘src’ attribute of <script> element is not a valid URI: “/js/pin.js?w=xrwar”  {d3d8e0ac-95df-44d3-ae73-7e7dfd5d5eec}:1
‘src’ attribute of <script> element is not a valid URI: “/js/omnibus.js?opad”  {d3d8e0ac-95df-44d3-ae73-7e7dfd5d5eec}:1
‘src’ attribute of <script> element is not a valid URI: “/js/shortcuts.js”  {b78a5061-5a4d-4371-9e98-be2735a74067}:1
‘src’ attribute of <script> element is not a valid URI: “/js/pin.js?w=xrwar”  {b78a5061-5a4d-4371-9e98-be2735a74067}:1
...
OS: Mac OS X → All
Component: General → Untriaged
(In reply to Marco Bonardo [::mak] from comment #3)
> Does the page reload constantly (could probably be verified through the
> network dev tool)? We have a bug where on a new visit we clear and repaint
> the icon, I wonder if it's the case that this page just reloads continuously
> and we try to seticon at every reload!?
> Though, I'd not be sure why this would only be an issue on Mac, we set the
> attribute in the same exact way on all the platforms, maybe it's just a
> different way of painting in imagelib, not sure.
> 
> I don't have a Pocket account, I may have to create one to test this.
> 
> The tab icon is unrelated to the icon in the bookmarks view, they may be the
> same, but it's not mandatory atm, that's because one of the 2 may have a
> better resolution than the other one and for now we pick the best resolution
> (some of the follow-up work may improve this). Also if the flickering
> happens in the tab rather than in bookmarks view, it could also be a
> completely different problem, since they are independent as of now.

The favicon for my bookmark at https://people-mozilla.org/~shorlander/styleguide/ui-elements/ also does this.

Pocket and People flicker regardless of whether I have them open in a tab or not.

I do not see flickering in a tab.
(In reply to Stephen Horlander [:shorlander] from comment #8)
> Pocket and People flicker regardless of whether I have them open in a tab or
> not.

Both things are very surprising, the directory listing is very unlikely to refresh at all, especially if it's closed :(
I have 2 theories atm:
1. graphics problem of some sort
2. May Sync be involved when adding a bunch of visits? Ideally it should do nothing with icons though.
3. Maybe something else is loading the page to collect info like a thumb?

So, globally I'm not 100% sure this is related to the favicons store, especially if it seems to only happen on Mac (Chris has seen similar flickering on Windows too, but he could reproduce in earlier versions of Firefox, that likely don't have the new favicons store at all).
I hope to be able to reproduce this somewhere where I can start a debug build and check some API calls, so far none of my many bookmarks is showing flickering...

We need some additional relation between a specific icon flickering and something else special about that page (an add-on using it, it being in newtab page or another specific view, ...)
For example, could you check if in the folder where we store thumbnails (on Windows its "AppData\Local\Mozilla\Firefox\Profiles\random_stuff.default\thumbnails", on Mac it should be under Library/Mozilla) there's a thumbnail for the pages you see flickering?
Component: Untriaged → Bookmarks & History
(In reply to Nate Weiner from bug 1375908 comment #2)
> This may be completely coincidence, but it seems like the more that I tab
> switch, the more frequently it flickers.

Markus, any chance this is graphics-related? How would we check?
Flags: needinfo?(mstange)
Not sure. The best tool for figuring out what's going on here would be a debugger.
Flags: needinfo?(mstange)
It's happening consistently in my Nightly build. If it's be helpful to hop on Vidyo and look through a debugger on my computer just ping me on Slack. I'm @nate.
(In reply to Marco Bonardo [::mak] from comment #10)
> For example, could you check if in the folder where we store thumbnails (on
> Windows its
> "AppData\Local\Mozilla\Firefox\Profiles\random_stuff.default\thumbnails", on
> Mac it should be under Library/Mozilla) there's a thumbnail for the pages
> you see flickering?

I don't seem to have this folder (on Mac) checked:

- /Library/ (No Mozilla folder)
- ~/Library/Mozilla/ (Just have an empty Extensions folder)
- ~/Library/Application Support/Firefox/Profiles/(my profile)/ (Don't have a thumbnails folder)
(In reply to Nate Weiner from comment #14)
> It's happening consistently in my Nightly build. If it's be helpful to hop
> on Vidyo and look through a debugger on my computer just ping me on Slack.

It would be ideal if we could find steps to reproduce so that one of us can debug this locally on their own machine.
Barring that, the next best thing would be to give one of us access to a Firefox profile that shows the problem.
The third best option would be to compile a debug build of Firefox locally and give one of us ssh access to the machine.
Debugging a regular Nightly is not likely to lead to success.
(In reply to :Gijs from comment #12)
> (In reply to Nate Weiner from bug 1375908 comment #2)
> > This may be completely coincidence, but it seems like the more that I tab
> > switch, the more frequently it flickers.
> 
> Markus, any chance this is graphics-related? How would we check?

I don't think this is graphics-related because when it is happening I see an endless stream of "‘src’ attribute of <script> element is not a valid URI" errors from the bookmarked page in the browser console. I disabled Sync, restarted Firefox, and could still repro the flickering.
For what matters the favicons service it would be interesting to check if, when this happen, in a debugger we enter continuously into one of these methods:
1. setAndFetchFaviconForPage
2. copyFavicons in a loop when this happens, and get js and cpp stacks causing that.
both methods are in nsFaviconService.cpp

IF one of the 2 methods is invoked often, it would then be useful to get cpp and js stacks for a couple of the calls.
Chris, do you have Activity Stream enabled?

I did some testing with Stephen on his Mac, and we see a long list of favicons updates only when Activity Stream is enabled. Do you have the Activity stream add-on enabled?
Flags: needinfo?(mak77) → needinfo?(cpeterson)
Tim, we see a lot of background activity coming from the AS add-on, like favicons being continuously fetched and updated.
Could you please ask someone to look into this? I'm available to support that investigation from the favicons service side.
Flags: needinfo?(tspurway)
Thanks, Marco.

Kate, could you take a look at this and see if we are hitting the network unnecessarily.
Flags: needinfo?(tspurway) → needinfo?(khudson)
(In reply to Marco Bonardo [::mak] from comment #19)
> Chris, do you have Activity Stream enabled?

Yes! If I disable Activity Stream and restart Firefox, then the flickering seems to stop. Re-enabling Activity Stream and restarting Firefox, I can reproduce the flickering. So it does seem related to Activity Stream, but I can't say this confidently because the flickering is intermittent.
Flags: needinfo?(cpeterson)
Is this for the version in Test Pilot or Activity Stream behind browser.newtabpage.activity-stream.enabled? Thanks!
Flags: needinfo?(khudson) → needinfo?(cpeterson)
(In reply to Kate Hudson :k88hudson from comment #23)
> Is this for the version in Test Pilot or Activity Stream behind
> browser.newtabpage.activity-stream.enabled? Thanks!

The Test Pilot version is what caused it for me. Nightly's browser.newtabpage.activity-stream.enabled does not seem to have the same behavior.
Summary: Favicons Flickering in UI → Favicons Flickering in UI with the Activity Stream Test Pilot
(In reply to Kate Hudson :k88hudson from comment #23)
> Is this for the version in Test Pilot or Activity Stream behind
> browser.newtabpage.activity-stream.enabled? Thanks!

Like Stephen, I can reproduce the flickering with the Test Pilot extension but not with the browser.newtabpage.activity-stream.enabled pref.

Perhaps this is a regression in the Test Pilot extension code that hasn't landed in Nightly yet or perhaps some issue with Firefox's extension support?
Flags: needinfo?(cpeterson)
We have a bug in favicons that causes some over-notifying (bug 1360158) to the bookmarks views when an icon is stored, even if it was already known. my suspect is that the AS Test Pilot has always caused these frequent setting of icon calls (not sure if by repeated API calls, or page reloads), and bug 1360158 just made them visible.
We could surely fix the over notification problem, but at the same time there's also a bug in the Test Pilot that causes this to happen more frequently than expected (and may thus cause also performance problems).
Priority: P1 → P3
See Also: 1393313
I think there's no point in keeping this open, it was clearly caused by the add-on, there are still bug 1360158 open to reduce the number of icons notifications and bug 1393313 for a graphics problem.
The integration of AS in the browser doesn't suffer of this problem.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: