Hi,
We discovered an issue which involves Dexie/IndexedDB on Firefox 67 (upcoming release). It is not clear if the issue is from Firefox or IndexedDB or Dexie or a combination. We currently could not reproduce the same issue with IndexedDB only so we did not rule-out the possibility of Dexie playing a role. The following WebExtension is enough to reproduce:
import Dexie from 'dexie';
setTimeout(() => {
const db = new Dexie('test_db');
db.version(1).stores({ test_table: 'test_key' });
db.transaction('rw', db.test_table, () => db.test_table.toArray().then(console.log).catch(console.error));
}, 8000);
The delay of 8 seconds is meant to give time to open the dev-tools/console in about:debugging, which is necessary to trigger the issue. This same code has two outcomes, depending on if the dev-tools were opened before this timeout runs:
{
"_e": {},
"name": "InvalidStateError",
"message": "An attempt was made to use an object that is not, or is no longer, usable",
"inner": {},
}
[] is printed (empty collection)We put together a repository with detailed steps to easily reproduce this issue locally: https://github.com/remusao/firefox-67-idb-bug-repro
We also opened a ticket on Firefox's bug-tracker, but thought that this might be of interest for the developers of Dexie: https://bugzilla.mozilla.org/show_bug.cgi?id=1545400
Some further observations:
Dexie 2.0.7 as well as 3.0.0 alphaThanks for the great library!
_Edit_: We were also able to reproduce this issue from a single web-page, which allows any site to detect if dev-tools are opened or closed: https://cdn.cliqz.com/browser-f/fun-demo/firefox_devtools.html
I also see this, pretty annoying, is there an issue at https://bugzilla.mozilla.org/home?
@sechel We have opened an issue on bugzilla here: https://bugzilla.mozilla.org/show_bug.cgi?id=1545400. The investigation is currently in progress.
Loos like a fix for that will ship with Firefox 69 - thanks for filing the bugzilla ticket!
Most helpful comment
@sechel We have opened an issue on bugzilla here: https://bugzilla.mozilla.org/show_bug.cgi?id=1545400. The investigation is currently in progress.