[Regression] Need to re-attach previously-attached DBs when reopening the profile




Firefox for iOS
Home screen
6 months ago
6 months ago


(Reporter: csuciu, Assigned: justindarc)




Firefox Tracking Flags

(fxios8.0+, fxios-v8.0 affected)


(Whiteboard: [mobileAS])


(2 attachments)



6 months ago
master 5d347f81e
iPhone 6 Plus (10.3)

1. Have a few items in the Top Sites/Highlights lists
2. Go to Settings and sign into sync (no need to confirm the sign in (if the account needed verification))
3. Exit Settings => Check the Top Sites panel

Result: All top sites and highlights (except the default top sites) were removed from the panel. 
The user's data will show up correctly in Top Sites panel after restarting the app.

Note: I don't think that this issue is related to FxA/Sync but I was able to reproduce it consistently only by following the steps above. 
I've also seen this issue happening intermittently when backgrounding/foregrounding the app while in Top Sites panel.

Comment 1

6 months ago
Was able to reproduce the issue by refreshing the default tab. Here's the log https://pastebin.mozilla.org/9019428


6 months ago
Assignee: nobody → jdarcangelo
In case it is helpful, I think I have reproduced this problem where the top sites dissapear following these steps:

1. Open a new web site from new tab screen
2. From that web site tap on back
3. The web site should appear on the top sites list
3.1 If it appears, tap on it and once in the web site, repeat step 2. If it is still shown fine, go to a different web site and go back
3.2 Sometimes it does not appear at first

Killing and restarting the app shows all top sites fine
Reproducible using the steps provided on my iPhone 7+ w/HEAD 5d347
Keywords: reproducible


6 months ago
See Also: → bug 1357755


6 months ago
Duplicate of this bug: 1357755


6 months ago
tracking-fxios: ? → 8.0+
Priority: -- → P1


6 months ago
Whiteboard: [mobileAS]


6 months ago
Iteration: --- → 1.20

Comment 5

6 months ago
This doesn't seem to have anything to do with Sync and can be reproduced even without ever signing into Sync. It is a problem re-attaching metadata.db. Here's a 100% reproducible STR:

1. Open app with clean profile
2. Enter a URL in the address bar (e.g. slashdot.org)
3. Close the tab and see the visited website appear in Top Sites panel
4. Tap the "[1]" in the top-right corner to minimize the Top Sites panel
5. While the Top Sites panel is minimized, press the Home button to background the app
6. Re-open the app to the foreground
7. Tap the minimized Top Sites panel and see it reset the database to the default sites; The following is logged:

2017-04-26 15:45:04.524 [Debug] [Profile.swift:307] reopen() > Reopening profile.
2017-04-26 15:45:04.524 [Debug] [BrowserViewController.swift:486] loadQueuedTabs() > Loading queued tabs in the background.
2017-04-26 15:45:04.524 [Debug] [SwiftData.swift:93] getSharedConnection() > >>> Creating shared SQLiteDBConnection for /Users/justin/Library/Developer/CoreSimulator/Devices/12C973F9-CBAC-47B5-85F2-D105EB8555EA/data/Containers/Shared/AppGroup/F0E6F39B-AC2D-42F1-869C-7AEDC332BF59/profile.profile/browser.db on thread <NSThread: 0x608000260900>{number = 18, name = (null)}.
2017-04-26 15:45:04.524 [Debug] [SwiftData.swift:510] init(filename:flags:key:prevKey:) > Opening connection to /Users/justin/Library/Developer/CoreSimulator/Devices/12C973F9-CBAC-47B5-85F2-D105EB8555EA/data/Containers/Shared/AppGroup/F0E6F39B-AC2D-42F1-869C-7AEDC332BF59/profile.profile/browser.db.
2017-04-26 15:45:04.525 [Info] [SwiftData.swift:475] prepareCleartext() > Enabling WAL mode.
2017-04-26 15:45:04.526 [Debug] [BrowserViewController.swift:500] dequeueQueuedTabs() > Queue. Count: 0.
2017-04-26 15:45:19.164 [Debug] [BrowserViewController.swift:520] viewWillAppear > BVC viewWillAppear.
2017-04-26 15:45:19.164 [Debug] [BrowserViewController.swift:522] viewWillAppear > BVC super.viewWillAppear done.
2017-04-26 15:45:19.164 [Debug] [BrowserViewController.swift:535] viewWillAppear > Restoring tabs.
2017-04-26 15:45:19.164 [Debug] [BrowserViewController.swift:537] viewWillAppear > Done restoring tabs.
2017-04-26 15:45:19.165 [Debug] [BrowserViewController.swift:540] viewWillAppear > Updating tab count.
2017-04-26 15:45:19.165 [Debug] [BrowserViewController.swift:543] viewWillAppear > BVC done.
2017-04-26 15:45:19.165 [Error] [SwiftData.swift:689] executeQuery(_:factory:withArgs:) > SQL error: SQL error or missing database no such table: metadataDB.highlights.
2017-04-26 15:45:19.181 [Debug] [BrowserViewController.swift:475] viewDidLayoutSubviews() > BVC viewDidLayoutSubviews…
2017-04-26 15:45:19.183 [Debug] [BrowserViewController.swift:482] viewDidLayoutSubviews() > BVC done.
2017-04-26 15:45:19.191 [Error] [SwiftData.swift:689] executeQuery(_:factory:withArgs:) > SQL error: SQL error or missing database no such table: metadataDB.page_metadata.
2017-04-26 15:45:19.590 [Debug] [BrowserViewController.swift:585] viewDidAppear > BVC viewDidAppear.
2017-04-26 15:45:19.590 [Debug] [BrowserViewController.swift:587] viewDidAppear > BVC intro presented.
2017-04-26 15:45:19.590 [Debug] [BrowserViewController.swift:591] viewDidAppear > BVC taking pending screenshots….
2017-04-26 15:45:19.591 [Debug] [BrowserViewController.swift:593] viewDidAppear > BVC done taking screenshots.
2017-04-26 15:45:19.591 [Debug] [BrowserViewController.swift:595] viewDidAppear > BVC calling super.viewDidAppear.
2017-04-26 15:45:19.591 [Debug] [BrowserViewController.swift:597] viewDidAppear > BVC done.

Comment 6

6 months ago
Created attachment 8862124 [details]

Here's the relevant part of the logs starting with shutting down the profile from backgrounding the app.


6 months ago
Summary: [Regression] Top Sites panel is cleared out after signing into sync → [Regression] Need to re-attach previously-attached DBs when reopening the profile

Comment 7

6 months ago
Created attachment 8862131 [details] [review]
GitHub Pull Request
Attachment #8862131 - Flags: review?(sleroux)
Attachment #8862131 - Flags: review?(sleroux) → review+

Comment 8

6 months ago
Landed on master:

Last Resolved: 6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.