Dexie.js: What to do on an UnknownError? (in Electron)

In my application I am getting this error from time to time when accessing the database:

UnknownError: Internal error opening backing store for indexedDB.open.

Is there a best-practice on how to recover from such an error?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 25 (8 by maintainers)

Most upvoted comments

The Electron team has a response to this issue: https://github.com/electron/electron/issues/10792#issuecomment-336528812

Following that advice leads to a deprecated API app.makeSingleInstance(), replaced with app.requestSingleInstanceLock()

Conclusion

Electron apps have to be single instance if using any common resource (like indexeddb for example). This is simply accomplished by calling app.requestSingleInstanceLock(). Users can still double click a desktop icon (on Windows) or right-click in Dock and choose “New window” (on Mac). In your callback to app.on('second-instance', ...) you decide what should happen when a user starts a second instance. You could either focus the main window, or launch another window within the same app instance.

Thanks, that would be great. I think you could just create a browser view that opens test/run-unit-tests.html. Need to have built it first with npm run build. Please fork Dexie.js and build it with npm install and npm run build (or follow the contributing guide)

This and #269 makes me a bit worried over the stability of indexedDB in Electron. I would very much like to launch Dexie’s unit test suite within an electron app to see if it behaves there or not.