Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Error recovery for default store eg when Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. occurs #165

Open
TedChenNZ opened this issue Jul 3, 2023 · 2 comments

Comments

@TedChenNZ
Copy link

TedChenNZ commented Jul 3, 2023

Feature Request - Error recovery for default store

Currently if we run into an error using the default store, there is no way to recover without refreshing the page.

This is due to the cache of defaultGetStoreFunc which means we keep the same connection for the default store, and we have no method of resetting it.

The error and reproduction steps (sort of)

The error that I'm seeing in production is Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing..
I believe this mainly happens when a user has a connection open, sleeps the computer, then wakes it later. However I have trouble reproducing it in that manner. Others seem to have this issue too eg https://bugs.chromium.org/p/chromium/issues/detail?id=1085724

The one way I can reproduce this error 100% of the time is to manually delete the indexed-db database (though I don't think that's what users are actually doing just due to the sheer amount of times that we're experiencing the 'failed to execute transaction' error according to the Sentry logs). Attached is a gif and a sandbox of how I reproduce this error

no error recovery

https://codesandbox.io/s/competent-star-8gkf4c?file=/src/App.js

Workaround

My current workaround is use a customStore rather than the default store, and creating a new custom store if the error occurs.

eg
workaround

https://codesandbox.io/s/keen-davinci-3sg268?file=/src/App.js

@Parakoos
Copy link

I have this issue a lot too. And there is no way to recover. Your solution works, I guess, but you loose the data in the datastore...

@zarko-tg
Copy link

I wonder if this library/GitHub project is alive / maintained even though the root cause might be within Safari (iOS).
Has anyone been able to create a proper reproduction case or found a solution in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants