Closed Bug 877952 Opened 11 years ago Closed 11 years ago

IndexedDB upgrade should proceed even when file manager directories are not present

Categories

(Core :: Storage: IndexedDB, defect)

21 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: TailsTheKitsune, Assigned: bent.mozilla)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130511120803

Steps to reproduce:

Load page with Greasemonkey userscript that utilizes Indexeddb.


Actual results:

Page will work fine for approx a day (more than just a browser session, but always reproducable for me after a day). But after a day, the DB will no longer work. Firefox throws an "Unknown Error" upon attempting to connect. The only solution is to delete the entire corrupted DB and start over each day. onupgradeneeded doesn't even trigger if you increment the version. It goes straight to onerror.

Additional notes: 
Could be an issue with Greasemonkey script privilidges?
This FF profile is copied to and from a 512mb ramdisk. Any way to tell if the DB gets wiped due to space issues? There's also a small window of time with trivial use on this profile after the final backup for the day (But nothing is stored outside a profile that could invalidate an Indexeddb right?).


Expected results:

Indexeddb data shouldn't corrupt.
Attachment #756337 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 756920 [details]
A corrupted DB that can no longer be accessed or upgraded.

It looks to me like this database is not actually corrupted (both SQLite and Firefox can both read it on my local machine just fine). At least you're not losing data here.

We still have to figure out why your machine won't let you access it though...
XFox, this rar file contains an indexeddb folder with just the database inside. In your profile is there also a '81088804Gsernekdil_oPhleac' directory beside the '81088804Gsernekdil_oPhleac.sqlite' file?
(In reply to ben turner [:bent] from comment #3)
> XFox, this rar file contains an indexeddb folder with just the database
> inside. In your profile is there also a '81088804Gsernekdil_oPhleac'
> directory beside the '81088804Gsernekdil_oPhleac.sqlite' file?

Or do you have any kind of tool running that would remove empty directories? Or maybe the rar compressor removes empty directories?
That empty directory wasn't present. I deleted the indexedDB directory's contents and started anew with a new upgrade and it was just created though. Then I learned that XCopy (native command) wasn't copying the empty folder. I'll remedy that. But why's the empty folder so critical? Why does it always remain empty? (Is that normal?). I've had this happen once before on another system (without moving the profile around), so I was about to isolate that detail. I'll look ingo that one too. Thanks for finding this.
It's not really critical, it's just that we assumed that the directory would always be present. We try not to do much if we detect that a user has changed their profile directory so that we don't delete data.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Indexeddb corrupts intermittently (Unknown Error upon connect) → IndexedDB upgrade could be more robust
Attached patch Patch, v1Splinter Review
Jan, this patch fixes the upgrade path if the file manager directory is for some reason not present. I don't think it hurts to be a little forgiving here.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #757184 - Flags: review?(Jan.Varga)
Summary: IndexedDB upgrade could be more robust → IndexedDB upgrade should proceed even when file manager directories are not present
Comment on attachment 757184 [details] [diff] [review]
Patch, v1

Review of attachment 757184 [details] [diff] [review]:
-----------------------------------------------------------------

looks good, thanks!
Attachment #757184 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/92b8261c3f6e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.