-
Notifications
You must be signed in to change notification settings - Fork 114
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' #503
Comments
Any update on this @rgomezp ? |
@pedromcunha We have only seen this error if you clear your browser data (either as a whole or specifically for your site). Are you able to reproduce the issue in any other cases? If so can you provide the full steps to reproduce and a full stack trace? Thanks. |
Closing due to inactivity |
I guess the question is why is the error not caught within the OneSignal code itself (as opposed to a js console error) and if such occurs why is there no error handling provided to the user and particularly to the back end OneSignal server to remove the user from the OneSignal active or subscribed users so that they can restart the process from the client side |
We have made a note of this issue internally and plan to fix it in the future. Thanks for your input |
Hey! any updates about this bug? I've got the same one, in case user first visit the site we've got this issue, in other cases everything is fine. |
Thanks for your patience while we resolve |
@Paxarik , @connetcom , @pedromcunha , |
in running my own PWA with DB and service worker, i notice this error in my own code which occasionally occurs after i do a reset storage and then restart the PWA. The issue for me occurs when the DB is created and then the datastore is attempted to be accessed but the datastore has not finished being created yet (is all async). Maybe this is something to look at - i.e., the timing of the access to a data store or putting some promise or something to make sure the datastore is created before access. |
@connetcom , |
Sorry for late reply, so, in a sense, yes it has to do with the PWA and more particularly with the testing of the PWA because it only occurs when the DB gets recreated after i manually do a clear storage in the debugger. As said, i am not quite sure but i believe it has to do with the Async nature of how the calls to the DB are made and a lot seems to be going on when the PWA is coming up which might (?) cause some delays. Also, it would seem certainly possible to code around this (which i assume that the onesignal code does not and i have not gotten around to doing myself but did think about a bit and certainly seems feasible) by not attempting to use the datastore until the DB has actually completed the creation of the datastore (would seem some promise could handle this). So, I have not really had an issue with it in the production code but knowing that it can happen on my test system does not give a warm fuzzy about the likelihood of it never happening in production. I would say that OneSignal should spend the time to resolve it. |
@connetcom , |
Closing due to no response |
See update in #716 -- let's try to get a min-reproducible. |
See also update in #671 |
@rgomezp Hi! this issue happens on a ReactJS app (Google Chrome, MacOS) as well. Please consider that a final user can clear the cache but not necessary open a new tab which will result on devtools showing InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase' maybe in the future the users will open a new tab but there's a high change they don't do it the first time. The React code I'm working on is not a PWA nor has an DB connection besides the one from OneSignal. The React app is just a demo app I'm creating for an article I'm writting |
I'm also having this issue, i get it on sentry |
Same here. Happens even when doing absoutely nothing (not adding in any javascript at all). Looks to be caused solely by the service worker which is Completely clearing data does nothing. Reproducable every time. |
I noticed in our error tracker I get these errors roughly 50/hour.
Error · Uncaught (in promise): InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. Error: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing. at Promise (https://cdn.onesignal.com/sdks/OneSignalPageSDKES6.js?v=150701:1:42046)
It's happening 100% of the time on all versions of Chrome (Mac and Windows), for anonymous and logged in users of our web app. Any idea what's happening here?
The text was updated successfully, but these errors were encountered: