Suddenly, none of my IndexedDB open request callbacks are invoked?

时间:2015-09-14 16:05:15

标签: javascript google-chrome indexeddb

I have had the same (working) code opening my various Indexeddb databases for the past 3 months.

Earlier this morning, they just stopped working. None of my callbacks from my window.indexeddb.open()request are ever called. And they used to!

request = window.indexedDB.open(dbName, 1);

request.onblocked = function(e) {
   console.log("onblocked");
};

request.onupgradeneeded = function(e) {
    console.log("onupgradeneeded");
};

request.onsuccess = function(e) {
    console.log("onsuccess");
};

request.onerror = function(e) {
    console.log("onerror");
};

I have tried different db versions, completely clearing my browser's IndexedDB data, Incognito browsers, just about everything I can think of. The same behavior happens every time - there are no errors in the console, the db is never opened and no callbacks are ever invoked.

Could this be a Chrome update that caused this? Has anyone else experienced this?

I found a similar issue, but it was back in 2012: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-html5/QvjsPbBdP4M/lK5UcnbkXhMJ

I am going a little bit crazy with this one and would appreciate any suggestions.

Update

This happens to be a Cordova/Ionic application and when the same code is loaded on an Android device, the databases open as expected, which tells me it is something very specific to my version of Chrome on my Mac: Version 45.0.2454.85 (64-bit)

1 个答案:

答案 0 :(得分:0)

我必须从计算机上完全卸载Google Chrome。重新安装后,一切都恢复了。我没有丝毫的线索,我设法让我的浏览器进入了一个奇怪的,不稳定的状态,但完全重新开始解决问题。希望这有助于其他许多人遇到这种情况。