Closed
Bug 327971
Opened 20 years ago
Closed 20 years ago
schema version checker failure blows away existing db tables
Categories
(Calendar :: Provider: Local Storage, defect)
Calendar
Provider: Local Storage
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dmosedale, Assigned: dmosedale)
References
Details
(Keywords: dataloss)
Attachments
(1 file)
|
3.53 KB,
patch
|
jminta
:
first-review+
|
Details | Diff | Splinter Review |
If the schema version checker for calStorageProvider fails for some unknown reason, the provider will attempt to drop all the tables and start over. It should really just use the error-announcer to notify the user.
| Assignee | ||
Updated•20 years ago
|
Assignee: nobody → dmose
Whiteboard: [ETA 2/21]
| Assignee | ||
Updated•20 years ago
|
Whiteboard: [ETA 2/21] → [ETA 2/23]
| Assignee | ||
Comment 1•20 years ago
|
||
Up until now, versionCheck was this weird combo function that returned magic constants to indicate errors and used those to decide whether to try and initialize the database. I changed the calling code to explicitly look for a version table as a mechanism to decide that, and renamed the function to getVersion, made it only return the version number, and throw exceptions in case of trouble.
Attachment #213012 -
Flags: first-review?(jminta)
| Assignee | ||
Updated•20 years ago
|
Whiteboard: [ETA 2/23] → [ETA 2/24]
Comment 2•20 years ago
|
||
Comment on attachment 213012 [details] [diff] [review]
patch, v1
- selectSchemaVersion.reset();
+ dump ("++++++++++++ DB Error: " + this.mDB.lastErrorString + "\n");
As we discussed in irc, this might be superfluous. If you want to keep it, at least identify the code area where you're dumping this from. Something like "getVersion() DB Error:"
Just a reminder to test to make sure we don't need read-only mode here, since createCalendar() ought to fail.
r=jminta with that.
Attachment #213012 -
Flags: first-review?(jminta) → first-review+
| Assignee | ||
Comment 3•20 years ago
|
||
Turns out createCalendar does fail, but getCalendars eats that failure (bug 328617 filed) and it doesnt propagate to the calling code. Since getCalendars is what is used to create the error announcers, this means that there is no announcer for the calendar in question for us to use to display this to the user. However, an exception does show up in the JS console. Since the behavior with this patch is much, much better than the behavior without this patch, Ive filed bug 328618 to deal with that. Im not sure whether 328618 should block 0.1, though I kind of suspect not.
Whiteboard: [ETA 2/24]
| Assignee | ||
Comment 4•20 years ago
|
||
Changed the dump() as suggested and landed this fix. Lets continue any error-handling discussion in bug 328618.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•