Closed Bug 1384196 Opened 7 years ago Closed 7 years ago

Don't attempt to create the schema table twice during database recovery

Categories

(Firefox for iOS :: Data Storage, defect, P1)

All
iOS
defect

Tracking

()

RESOLVED FIXED
Iteration:
1.26
Tracking Status
fxios-v7.6 --- ?
fxios 8.1+ ---
fxios-v8.0 --- affected

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Keywords: regression, Whiteboard: [MobileCore][DataLoss])

Attachments

(1 file)

55 bytes, text/x-github-pull-request
justindarc
: review+
Details | Review
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.
Attached file PR
Attachment #8889958 - Flags: review?(jdarcangelo)
Regression from eadaa00537 (Bug 1339824).
Blocks: 1339824
Keywords: regression
Attachment #8889958 - Flags: review?(jdarcangelo) → review+
Iteration: --- → 1.26
Priority: -- → P1
Whiteboard: [MobileCore]
Landed on master:

https://github.com/mozilla-mobile/firefox-ios/commit/ee30a125f40818758983000805d8a61d35d51e38
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [MobileCore] → [MobileCore][needsuplift]
Whiteboard: [MobileCore][needsuplift] → [MobileCore][DataLoss][needsuplift]
Whiteboard: [MobileCore][DataLoss][needsuplift] → [MobileCore][DataLoss]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: