-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. #7954
Comments
I did see there is another issue (closed) that's why I decided adding a new one: #7412 |
I've run into this as well, and my current theory is the browser is suspending the IDB connection when it's backgrounded and screws up any active PouchDB instances. Our main browser usage was iOS Safari, and it seemed to happen much more often once iOS 13 came out. We've also seen it on Windows Chrome, though. Unfortunately, our solution was to move away from PouchDB rather than trying to figure it out because it was also happening much too often and nearly impossible to debug. If we were going to attempt anything, it was going to be opening new PouchDB instances for data requests and closing them after they were finished so that connections weren't kept open when the browser backgrounded. |
@mattjennings you moved away from PouchDB to what? Just curious. |
@sureshvv We decided to move to GraphQL with Apollo, and with that we found apollo-offline to keep it working offline. It was not a straight-forward migration at all, but it worked for us. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is this on Safari only? |
Chrome - Both Linux & Android |
I confirm this also happens randomly on Windows too. Mostly Windows 7, Windows 10 (15%). I can't reproduce it |
I had noticed that we were using the newest pouchdb plugins but not the newest version of pouchdb itself. |
Hi We actually used sqlite adapter for mobile apps (were the idb was failing massively) and I can say we're good now. options.adapter = 'cordova-sqlite'; (it requires the sqlite plugin install if you're using Cordova/Ionic) |
… closed by the browser
… closed by the browser
… closed by the browser
… closed by the browser
Hi
We are getting "InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing." when we are trying to get a document, and it happens with a disturbing frequency (once in a day under standard usage - let's say approximately 1000 - 2000 db crud operations a day).
We see it happening on Chrome Desktop and on iOS WkWebVIew Safari (cordova)
The DB is around 5000 docs and it uses replication db.replicate.to and db.replicate.from (live: true, retry: true, checkpoint: false) to keep the data in sync.
On app startup we delay starting the replication for around 30 seconds just to make sure there the UI runs smoothly.
Any ideas / hints even on how to track or address this would be much appreciated.
The text was updated successfully, but these errors were encountered: