IndexedDB opens different database than specified.

RESOLVED INVALID

Status

()

Core
DOM: IndexedDB
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: Optimizer, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 629633 [details]
the object that manages the database

I use an indexedDB database to manage a log. wen I destroy the logging object, I close the database, and also delete it (see destroy function in the file provided).

But sometimes, the database does not gets deleted and when I open a new database with a different name, the previous database which was not able to get deleted gets opened, and data is read from that only. This keeps happening until I go manually to "Profile Directory > indexedDB > chrome" and manually delete the files.

Some important things to notice, the function DataStore is used to create 2 instances of it, say

let name = "asdf" + (new Date()).getTime();
let A = new DataStore(name);
let B = new DataStore(name);

and while A will only read data, B will only add data.

A.destroy() will be called earlier and then later on B.destroy(true) will be called.
So that means, the same database is opened twice, simultaneously, then one is closed, and just after the second is also closed, but the second deletes the database while closing.
(Reporter)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.