Closed Bug 1384196 Opened 2 years ago Closed 2 years ago
Don't attempt to create the schema table twice during database recovery
Initing a BrowserDB calls `createOrUpdate(self.schemaTable)`… then inside `createOrUpdate`‘s data recovery flow we _first_ do `doCreate(schemaTable)`, then call `doCreate` with each argument. If we would have lost data, and _now_ we correctly hit the recovery flow, we will attempt to create the schema table twice. This code _assumes_ that we’ll be failing when creating e.g., `BrowserTable`. The smallest possible fix is to not duplicate the creation of the schema table. The 'leaf' tables will return `.exists` in `doCreate`, but the schema table won't. Justin thinks this is a regression from adding the metadata table.
Attachment #8889958 - Flags: review?(jdarcangelo) → review+
Iteration: --- → 1.26
Priority: -- → P1
Landed on master: https://github.com/mozilla-mobile/firefox-ios/commit/ee30a125f40818758983000805d8a61d35d51e38
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Whiteboard: [MobileCore] → [MobileCore][needsuplift]
Whiteboard: [MobileCore][needsuplift] → [MobileCore][DataLoss][needsuplift]
Uplifted to v8.x
Whiteboard: [MobileCore][DataLoss][needsuplift] → [MobileCore][DataLoss]
You need to log in before you can comment on or make changes to this bug.