Closed Bug 1384196 Opened 2 years ago Closed 2 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)

PR
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: 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]
Duplicate of this bug: 1383652
Duplicate of this bug: 1383743
You need to log in before you can comment on or make changes to this bug.