Closed Bug 1260852 Opened 10 years ago Closed 9 years ago

Upgrade from 2.1 -> 3.0 causes logins to be missing

Categories

(Firefox for iOS :: Login Management, defect)

Other
iOS
defect

Tracking

()

RESOLVED INVALID
Tracking Status
fxios + ---

People

(Reporter: sleroux, Unassigned)

References

Details

Attachments

(1 file)

STR: 1. While on version 2.1, sign into FxA and sync logins 2. Wait for sync to complete 3. Verify that logins display 4. Upgrade to 3.0 5. Navigate to logins Expected: Logins should appear unchanged Actual: Logins no longer display
Looking at iTunes backups of my app, I see logins.db.bak.1 (400KB+) and a new empty DB created. That means we failed to open the database. Sync did not re-fill the new database, which means our corruption-handling code didn't run.
Works for me on my iPhone 5 (9.3) and iPhone 6 (9.3). To re-test I re-downloaded 2.1 (via the purchased section on the App Store) on both and re-updated both. Both are signed into my personal account.
Hypothesis is that if this is Keychain related you will not be able to re-attempt on a device: the Keychain lives longer than the app. Potential STR: * Clean metal. * Install 2.1. Save logins. * Possibly: install 3.0 Beta or a developer build of some kind. * Upgrade 2.1 to 3.0 from the App Store.
> Looking at iTunes backups of my app, I see logins.db.bak.1 (400KB+) and a new empty DB created. That means we failed to open the database. > Sync did not re-fill the new database, which means our corruption-handling code didn't run. From these, it sounds like either: 1. Logins DB became corrupted which it shouldn't have been. 2. Corrupted DB should repopulate new instance. 3. Both? Questions I have: 1. If a logins DB can be corrupted how does this happen and how is it related to the keychain? 2. If corrupted DB is encountered, what should happen?
(In reply to Stephan Leroux [:sleroux] from comment #4) > 1. If a logins DB can be corrupted how does this happen and how is it > related to the keychain? The first database operation will fail if the DB is malformed or our key is wrong. See BrowserDB.init: // Create or update will also delete and create the database if our key was incorrect. self.createOrUpdate(self.schemaTable) It might legitimately be corrupt (e.g., by the process being terminated and the filesystem lying about fsyncs), or we might not have the right key. Or any key at all. > 2. If corrupted DB is encountered, what should happen? If .createOrUpdate fails in BrowserDB, we move the database and send NotificationDatabaseWasRecreated. BrowserSyncManager listens for that, calling into handleRecreationOfDatabaseNamed, which resets Sync for the collections stored in that DB. The end result is that we sync again, downloading everything from the server. We tested this extensively in Bug 1226813 and Bug 1224692. Apparently in this case, on both of my devices, we did move the database. If we did reset the synchronizer (and the simplest explanation is that we did not), it certainly didn't affect the database that's in use by the frontend, or it didn't work for some other reason.
I've created a patch that adds an option to our debug menu for clearing anything our app puts into the keychain to simulate the 'fresh metal' experience. Hopefully this will help with reproducing the issue. Next step is going to cherry pick this on top of our production release, rebuild, and try to reproduce.
Tried the following without being able to reproduce: 1. Installed 3.0 modified version with wipe keychain debug option 2. Wiped keychain items associated with Firefox 3. Install 2.1 4. Sync up logins 5. Install 3.0 modified on top of 2.1 6. Logins appeared.
Looks like Maria was able to reproduce a similar issue but with browser.db instead of logins. Correct me if I'm wrong Richard but this sounds like this might rule out an issue related to the keychain and provides more evidence towards DB recovery after a corruption/upgrade.
Severity: normal → major
tracking-fxios: --- → ?
Flags: needinfo?(sleroux)
Will need a 'release branded' TestFlight build to further test upgrade scenarios over the App Store build.
Clearing NI for now. Let's see if we get any reports with the recent 4.0 release.
Flags: needinfo?(sleroux)
Status: NEW → RESOLVED
Closed: 9 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: