You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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?
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
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
https://codesandbox.io/s/keen-davinci-3sg268?file=/src/App.js
The text was updated successfully, but these errors were encountered: