learningequality / studio

Content curation tools for Kolibri
https://studio.learningequality.org/
MIT License
117 stars 163 forks source link

Deleting IndexedDB can result in inability to connect to the database until you restart Chrome #2094

Open rtibbles opened 4 years ago

rtibbles commented 4 years ago

Summary

Wiping out the IndexedDB can lead to this error happening whenever it is then accessed, even after a page refresh: Uncaught (in promise) Error: InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.

This seems to be an issue in Chrome specifically, and is widely reported on many libraries using IndexedDB: tutao/tutanota#452 localForage/localForage#581 localForage/localForage#694 https://github.com/firebase/firebase-js-sdk/issues/1926 https://github.com/pouchdb/pouchdb/issues/3415 https://github.com/jensarps/IDBWrapper/issues/80

And twice in Dexie.js: https://github.com/dfahlander/Dexie.js/issues/613 https://github.com/dfahlander/Dexie.js/issues/934

Category

BUG

Usage Details

This seems to be somewhat difficult to reproduce, but once it does, the only way to get rid of it is to restart Chrome.

kollivier commented 4 years ago

It has reproduced quite reliably for me, and seems to not take long after I start using Studio for it to occur. I think the first time I remember seeing it was while trying to switch users, though I don't know if that's directly related in any way.

kollivier commented 4 years ago

Another possibility is that I've found I often need to clear out indexedDB due to seeing incorrect data (e.g. channel list, etc.) displayed in the browser, for reasons I haven't yet completely nailed down. (I know issues with switching users is part of the cause, but does not explain all the issues.)

nucleogenesis commented 4 years ago

I am tickled that I found this issue by Googling the Chrome error message, finding https://github.com/jensarps/IDBWrapper/issues/80 and scrolling down to see @rtibbles and a link to here.

the only way to get rid of it is to restart Chrome

Can confirm ^ thanks!