-
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
Infinite loop on driver open fail #511
Comments
Perhaps we could remove this fallback and just reject the promise. The mechanism in the main localforage.js module can handle the fallback to the next preferred driver. I had seen that earlier, before the es6 refactor and started a discussion about it in an other issue, but can't find it right now. This was probably used before the fallback-on-fail mechanism was introduced, to prevent some missconfigurations. |
@thgreasi so your saying we might not have to do self.setDriver(self.LOCALSTORAGE), it looks like indexdb does it this way (just resolves it):
|
Exactly. I think that catch should just do a reject().
|
yes, it is easy to repro:
with:
results in this:
|
I guess we will have to add a test with since monkey patching... |
We might be able to redefine window.openDatabase to ‘undefined’ so that it throws an exception during a test, not sure I will have to play around with it. I’ll be pretty busy today, maybe tomorrow I can look into it Mike Marcucio blog http://blog.getitdoneapp.com/ | twitter https://twitter.com/GetItDoneBlog | facebook https://www.facebook.com/GetItDoneTasks | google+ https://plus.google.com/u/0/b/116698933997097774721/+Marcucio/posts
|
Or even better to a function that throws an error. |
…abase failed (saw this on BB10 cordova app) added tests for #511
Merged in #517 with some tidying. |
localForage/localForage#511 The result of it was that neither Chrome or Firefox worked on iOS with versions below 1.4
fix for bug where we were going into an infinite loop if the open database failed (saw this on BB10 cordova app)
I don't think we should call _initStorage again since it just failed
fixed in pull request: #510
The text was updated successfully, but these errors were encountered: