Closed Bug 416173 Opened 12 years ago Closed 12 years ago

BackupDB is completely useless

Categories

(Toolkit :: Storage, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

(Keywords: addon-compat, dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

BackupDB is completely useless since you'd want to use it when you cannot open a connection, but we don't return a connection when you cannot open this.  Requesting blocking since this blocks a firefox3 blocker (bug 386768)
Flags: blocking1.9?
Consumers of this API will need to be updated.
Attached patch v1.0 (obsolete) — Splinter Review
So this changes our behavior a little bit.  We've always had the connectionReady attribute, but never really advocated it's use.  Now we'll depend on it, so consumers should check if the connection is ready before using it.  If it isn't ready, they should assume the database is corrupted, back it up (if they want to), and start over.

This is a late api change, but I think we need it for a method like backupDB to work effectively.
Attachment #301964 - Flags: review?(vladimir)
Whiteboard: [has patch][needs review vlad]
Comment on attachment 301964 [details] [diff] [review]
v1.0

Looks fine, but can you add some more documentation suggesting a backup if the database connection failed?  Just so that people have an idea of what they could do if the database open fails.
Attachment #301964 - Flags: review?(vladimir) → review+
Attached patch v1.1Splinter Review
Addresses review comments.
Attachment #301964 - Attachment is obsolete: true
Attachment #301978 - Flags: approval1.9?
Whiteboard: [has patch][needs review vlad] → [has patch][has review][needs approval]
Blocks: 416205
Blocks: 416207
Blocks: 416208
Comment on attachment 301978 [details] [diff] [review]
v1.1

a1.9+=damons
Attachment #301978 - Flags: approval1.9? → approval1.9+
Whiteboard: [has patch][has review][needs approval] → [has patch][has review][has approval][can land]
Flags: blocking1.9? → blocking1.9+
Checking in storage/public/mozIStorageConnection.idl;
new revision: 1.15; previous revision: 1.14
Checking in storage/public/mozIStorageService.idl;
new revision: 1.8; previous revision: 1.7
Checking in storage/src/mozStorageService.cpp;
new revision: 1.15; previous revision: 1.14
Checking in storage/test/unit/head_storage.js;
new revision: 1.7; previous revision: 1.6
Checking in storage/test/unit/test_bug-416173.js;
initial revision: 1.1
Checking in storage/test/unit/corruptDB.sqlite;
initial revision: 1.1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Flags: in-litmus-
Resolution: --- → FIXED
Whiteboard: [has patch][has review][has approval][can land]
Documentation updated.
Blocks: 418804
Depends on: 418819
Blocks: 418819
No longer depends on: 418819
Blocks: 418897
Blocks: 423273
You need to log in before you can comment on or make changes to this bug.