-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 read the 'error' property from 'IDBRequest': The request has not finished #910
Comments
I don't think it's a size of storage, maybe it's some kind of data that's stored in DB. |
Hey, is there any chance this the new version of Safari? I'm hitting this on iOS Safari and Desktop and I've tried multiple IndexedDB libraries and rolling my own. My test system syncs the same data between these browsers. Any thoughts? |
Safari on iOS 13 (and 12) indeed has some serious problems with IndexedDB: https://bugs.webkit.org/show_bug.cgi?id=197050 |
I just got hit by this as well.
I've just checked our live/production telemetry data, and looks like 243 users are affected by this and counting. It's happening on : OS X Safari I can't see any errors from Safari 12 in our telemetry logs, neither from Safari 13.0.0 (released Sept 19), but Apple released 13.0.1 on Sept 24 (5 days after 13 was released) so there's a high chance Safari 13 introduced this bug, and we never ran into this for 5 days (or our affected users updated straight to 13.0.1) Will keep this thread updated with further findings. |
I confirm that I've reproduced in both small and large sizes.
It's not like that.
But I did it all once (not have more time), for confirm that it can help fix, it need repeat ( I didn't do it).
|
+1 |
Same issue on Safari 13.0.2 (macOS 10.14.6). Any updates? |
Still the same issue on Safari 13.0.4 (13608.4.9.1.4) ( macOS 10.13.4 ). Any clues? |
Can confirm, clearing out site's data worked for some of our users. |
can it throw this error? |
@johnozbay I can confirm after deleting the data of the site the storage works again. But the error reappears over and over again. So a single wipe of the data doesn't remove the error. |
I'm encountering this only with users on the Google browser which (I think) uses the Safari Webview. Not encountering this with native safari or anything else. 100% of the sessions are |
@haydenth i am experiencing this with safari on macOS with latest updates |
I'm experiencing this one with iOS 13.3 along with ionic 4 using angular, this one works with the android simulator but none with iOS device, neither ios simulator |
Getting the same error here, it looks we have to wait till AAPL release a fix |
I am getting the same error, do you have any updates on it? |
Clearing site data worked for me. Thanks. To clear data of the site Safari > Preferences > Privacy > Manage Website Data > Select Local host > Remove All |
Also hitting this issue. Clearing site data works, but it keeps occurring - and users can't be expected to perform this clear procedure. Anyone find a workaround/fix? |
Possibly related? #874 |
it worked for me too |
It works, but it happens over and over again :/ |
any news on this? Is there a workaround? I can't expect users to clear site data this way. |
No update yet, but I'd be curious if #874 fixes it for anyone. I'll try to review that PR this week. |
Excellent, thank you. I'll pay attention to #874 |
Okay it's early days but using openKeyCursor seems to have fixed this issue for me, haven't been able to reproduce yet in the usual places. |
We'll probably need to do a feature check to see if it's available, agreed. But that's good to know! 👍 |
Also testing openKeyCursor here. So far seems to run fine on Chrome, also haven't run out of space on Safari in a while (which is the result of this bug most frequently.) I've been refreshing the page on Safari for about 10 minutes and have not yet reproduced. About to deploy a branch with several PRs merged in, to Beta environment, and will report back on what Sentry tells us over the next week. |
Branch, for those interested: https://github.com/lincolnthree/localForage/commits/all-fixes |
Hi guys, just letting you know - version 1.7.4 (including the mentioned PR with openKeyCursor) does not work for me unfortunately. |
I’m encountering this issue on iOS 13.5.1 using LocalForage 1.7.4 while calling keys() on an instance :( |
I also had this issue on version 1.7.4. The solution I found was to use only one instance instead of two. |
@UltimatePro-Grammer Can you explain what you mean by one instance instead of two? As far as I know, we are only using one instance. |
@lincolnthree I was using two separate instances, by using createInstance (e.g. foo and bar). Switching to one solved it for me (e.g. only using bar). I am not using the default |
I had this issue again. I am not sure why it was fixed for me before but am having this issue again. Edit 2: I have looked in to this. The actual error is thrown because the IDB request is being aborted. For some reason, Safari errors out with the error this whole thread is about when you try to access the error property on the abort object. This means there is some issue with Safari aborting and not providing an error message. Seems like a bug in Safari to me, and I'm not sure there is much we can do to get around that. |
The really simple work around for this is to write empty value instead of trying call clear method |
@Rafi993 Actually I get this issue when using setItem, so I think what happened to you was the same that happened to me earlier where it randomly stops happening. |
Now I am having this issue too |
Unfortunately, I also had to deal with this issue. I wanted to add a simple entry to the objectStore "Order", but for some reason the IDBRequest got aborted each time. Instead, it showed the InvalidStateError as mentioned above. Luckily, I found a workaround where I added dummy entries to a dummy ObjectStore, just to get it working. First, I created a new handler which provides the routine to add a test entry:
To not needlessly fill the database storage with dummy data, I used '.put' instead of '.add' on the ObjectStore to insert resp. update the entry. Next, I added a create statement for another ObjectStore called "Test":
In the last step, I added the following entry at the end of the document.ready function on every page:
As a result, my ".add" statement on the ObjectStore "Order" suddenly worked and never crashed again. I don't know why, but it seems to work for me. |
@marci1412 Do you have the indexedDB code for what didn't work? We might be able to submit a bug report if we have code that isn't dependent on localForage and shows that there is an actual issue with Safari. |
Upgraded from 1.7.3 from 1.9.0 and it doesn't solve the issue without database removal. |
Are there any updates on this? I have not been able to find a fix or work around for this. |
@mawilmouth number of fixes were suggested here. |
…ause of a transaction abort on setItem
I had the same problem when I was trying to remove whole DB:
but the database was removed successfully, only this annoying exception was present. So I am using |
Hello,
How to properly control the size of the storage?
I have few instances of localforage,
when ~ 3mb of data (166 keys) stored I try call
setItem
for new key I have in developer console error.InvalidStateError: Failed to read the 'error' property from 'IDBRequest': The request has not finished.
after this error other instance is available (exactly for reading, not sure for saving), but this instance (with error) not answer more (incl getItem), but before setItem I can request any data (getItem, keys, etc).
if I call like
localforage.setItem(..).then(console.log).catch(console.error)
catch -- never called
How do I write it right?
The text was updated successfully, but these errors were encountered: