Top Sites panel not updated after sync




Firefox for iOS
Home screen
3 years ago
3 years ago


(Reporter: sleroux, Assigned: sleroux)




Firefox Tracking Flags




(1 attachment)



3 years ago
Top sites items don't seem to populate on launch with connected profile and force syncing doesn't update the panel either. Navigating to items add them to the panel as if we were a new user. After 24 hours, synced top sites appear.

> [SL] Were you seeing nothing on the Top Sites panel or just not seeing the 
> latest history items populate? Also, did this start right after updating the 
> app?  Lastly, you mentioned you tried to force sync and that didn't refresh it.
> Did you try to navigate to a few web pages afterwards?

[KR] I saw the two preloaded thumbnails, and I had to ‘find’ facebook (ie it didn’t feel like it was part of the history as I had to ‘search’ for it first). I used the app a handful of times throughout the evening yesterday, and still not populated. It only populated about 2 hours ago now (24 hours after initial setup)

I definitely navigated – did my rounds on facebook, followed a babycentre article, and went to the bbc. So those thumbnails then showed up after visiting those pages. And now (as of 2 hours ago), I finally got the whole grid of thumbnails populated.

Comment 1

3 years ago
I tried the following:

1. Downloaded 1.1b1112 Aurora build (before the Top Sites caching work)
2. Opened it up, connected my FxA account, navigated around a bit
3. Top sites were populated correctly


4. Updated to 1.2b1201 Aurora
5. Launched the app (note: noticed a significantly longer startup time)
6. Opened top sites panel
7. Saw the default 2 tiles for a moment which then got replaced by my synced top sites

:kar, does this sound similar to the steps you took (except for the top sites not showing at the end)?
Flags: needinfo?(krudnitski)
Not quite. I loaded Firefox on my iPhone 6s for the first time and downloaded 1.2b1202 for the first time on that device. I signed into FxA and that's when it took 24 hours to populate top sites with my history.
Flags: needinfo?(krudnitski)


3 years ago
Keywords: steps-wanted

Comment 3

3 years ago
Hm I tried to do this a few times with the 1.2b1202 on my iPhone 6 (9.1) device and can't seem to reproduce :( :kar, do you mind uninstalling and reinstalling to see if this happens a second time around?
On my iPhone 6 (9.1) and iPad Air (9.1), I see top-sites populating after Sync. By the description, this reminds me of the bug of top-sites query racing against the collectionView creation.

Works for me.
We invalidate top sites after each completed sync:

    // These selectors run on which ever thread sent the notifications (not the main thread)
    func onProfileDidFinishSyncing(notification: NSNotification) {

We background-refresh after the top sites view loads, if the cache is invalid:

    override func viewDidLoad() {


    private func refreshTopSites(frecencyLimit: Int) {
        // Reload right away with whatever is in the cache, then check to see if the cache is invalid. If it's invalid,
        // invalidate the cache and requery. This allows us to always show results right away if they are cached but
        // also load in the up-to-date results asynchronously if needed
        reloadTopSitesWithLimit(frecencyLimit) >>> {
            return self.profile.history.updateTopSitesCacheIfInvalidated() >>== { result in
                return result ? self.reloadTopSitesWithLimit(frecencyLimit) : succeed()

so the only reasons why there would be no history visible in top sites are:

1. History didn't sync yet. If you have lots of bookmarks or logins, that would explain it.
2. You had enough local browsing data that the oldest-first history never showed in top sites. That doesn't seem to be the case here.
3. viewDidLoad isn't being called again. If the app stays resident in memory, the view won't be loaded again for a while.

If (3) is the culprit, we could consider having TopSitesPanel listen for sync-finish notifications so it can redisplay.
(In reply to Stephan Leroux [:sleroux] from comment #1)

> 4. Updated to 1.2b1201 Aurora
> 5. Launched the app (note: noticed a significantly longer startup time)

1.2 will vacuum the DB on open in order to change the page size, which essentially involves rewriting the entire file. This will be a one-time hit after upgrade. You should see

            Vacuuming to alter database page size from \(currentPageSize) to \(desiredPageSize).

in the log, and

            Vacuuming succeeded.


Comment 7

3 years ago
(3) doesn't seem to be the culprit. When switching panels, deinit is called and viewDidLoad is called when navigating back to TopSites. Same thing happens when you show/hide the HomePanelViewController.

1) Do clean install of Firefox
2) Go to settings, login to your account
3) Stay on settings screen until sync is done
4) Close Settings
5) Open the only tab in the tab tray

Expected: Top sites is populated
Actual: Only the two default tiles are there


6) Switch to bookmarks panel
7) Switch to top sites panel

Top sites are refreshed.
Summary: 24 hours delay in updating Top Sites panel with synced top sites → Top Sites panel not updated after sync
tracking-fxios: ? → 1.2+

Comment 9

3 years ago
Created attachment 8686249 [details] [review]
Link to Github pull-request:
Attachment #8686249 - Flags: review?(rnewman)
Attachment #8686249 - Flags: review?(rnewman) → review+

Comment 10

3 years ago

Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.2


3 years ago
Assignee: nobody → sleroux
You need to log in before you can comment on or make changes to this bug.