Skip to content
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

IndexedDB not working on IOS devices #220

Closed
saroj990 opened this issue Sep 1, 2015 · 26 comments
Closed

IndexedDB not working on IOS devices #220

saroj990 opened this issue Sep 1, 2015 · 26 comments
Assignees
Milestone

Comments

@saroj990
Copy link

saroj990 commented Sep 1, 2015

Hi All,
I am using indexedDB(angular indexedDB) in my application .it is running fine everywhere except IOS devices .I am using indexedDBShim.js for IOS which should use the WebSql if indexedDB is not supported.But i am getting errors.
Can anybody help me to get out of the problem?

@DickvdBrink
Copy link
Collaborator

Can you explain what errors you are having?

@ndevtag
Copy link

ndevtag commented Sep 18, 2015

Have the same Problem on IOS, using shim with the jQuery Plugin.
Getting an "AbortError", when try to use the put function on objectstore is created on the fly, when not exists:

var putPromise = db.objectStore(segmentname, true).put(JSON.stringify(jsonObject), key);

This calls the fail handler giving an "AbortError".

OS: IOS 9
TestCases indexeddb.shim.js runs successfull
TestCases jquery.indexeddb.js some
Someone any idea?

img_0594 1

img_0592 1

img_0593 1

@saroj990
Copy link
Author

I left using indexedDB for IOS devices its buggy in behavior . finally i used WebSQL for IOS and IndexedDB implementation for other devices.

@ndevtag
Copy link

ndevtag commented Sep 21, 2015

The shim uses WebSQL for indexedDB implementation. Unfortunately i have not the choice to left it. I have to get working this shim in IOS.

@JamesMessinger
Copy link
Collaborator

Try running these tests instead. It'll help us pin-down exactly what errors you're seeing

@saroj990
Copy link
Author

I have tested this on IPad but still no luck. it breaks i means stop somewhere in between and doesn't go further.

@saroj990
Copy link
Author

Does this shim work for you , just curious to know

@DickvdBrink
Copy link
Collaborator

Hmz,, failing for me on iOS 7.1 on the IDBFactory.deleteDatabase Test

should return an IDBOpenDBRequest
undefined is not an object (evaluating 'db.close') (deleteDatabase-spec.js)

I'm currently unable to debug this but it looks like there is something wrong..

@ndevtag
Copy link

ndevtag commented Sep 24, 2015

The shim do not work for me, but i have to get it work.

@JamesMessinger
Copy link
Collaborator

I don't have iOS 7.1 to test on, but I've tested on iOS 8 and iOS 9, and all of the tests pass, including the deleteDatabase tests.

@saroj990 and @ntagdev - It would be helpful if you could post some sample code that reproduces the error. Also, please make sure you read the known issues on iOS and use one of the two workarounds listed there.

@ndevtag
Copy link

ndevtag commented Sep 24, 2015

Ok, i've found the problem. The app did not use the shim in ios Safari, because window,indexedDb ist defined.

@saroj990
Copy link
Author

I don't know i may be wrong but i have tried this and got no luck.I wish i am wrong and it works for you.

@brettz9
Copy link
Collaborator

brettz9 commented Jun 22, 2016

@ntagdev or @saroj990 : have you manually called shimIndexedDB.__useShim(); in your code?

@brettz9
Copy link
Collaborator

brettz9 commented Jun 27, 2016

There appears to be a problem with iOS9 and IndexedDB for non-Safari browsers. Our new code (discussed in #252) forces iOS9 non-Safari browsers to use the shim despite them supposedly having IndexedDB support.

Until our next release, you can change your project's bower dependency line for "IndexedDBShim" to https://github.com/axemclion/IndexedDBShim#ios9 and run bower install in your project directory.

Closing for now but feel free to comment further or reopen if your issue is not resolved.

@brettz9 brettz9 closed this as completed Jun 27, 2016
@brettz9 brettz9 reopened this Jun 27, 2016
@brettz9
Copy link
Collaborator

brettz9 commented Jun 27, 2016

Apologies, it seems like there is nevertheless an issue with Safari too on iOS9?

@corse-xx
Copy link

corse-xx commented Sep 5, 2016

is there a full fix for this at all or even at ETA? I have currently reverted all the way back to v0.1.2 from 2014-09-22 and its working in that...but there have obvs been a few improvements since then :p

@brettz9
Copy link
Collaborator

brettz9 commented Sep 5, 2016

Sorry, no ETA. PRs welcome.

@corse-xx
Copy link

corse-xx commented Sep 6, 2016

doh, ok i will go back through the versions to see where it got broken (sorry id take a look at fixing it permanently but am mid project!) and post here if i see anything obvious.

@corse-xx
Copy link

corse-xx commented Sep 6, 2016

ok i'm not sure what i missed but under phonegap serve i can have this working and not working easily...

  1. downloaded the 2.2.1 repo and copied indexeddbshim.min.js into my app - Work FINE in ios9
  2. downloaded the master repo and copied indexeddbshim.min.js into my app - broken immediately

The file size differences in the min files are immense (46kb to 230kb), did i miss something here?

@brettz9
Copy link
Collaborator

brettz9 commented Sep 6, 2016

If you are looking for the latest working version for ios9, it'd be fine to go back and see where it got broken, but if you are willing to debug and get all of the benefits of the many bug fixes, I would just start with the latest in master and see where we can fix it for ios9.

As far as master being broken for ios9, yes, that is known. I would just try digging around in the code and checking console and see what turns up.

As far as file size, the new code is being transformed by babel. Looking at the non-minified code, a large amount of that code is taken up by babel-polyfill which I have imported to allow us to use some other ES6 convenience features. If the import statement in setGlobalVars.js is removed, the grunt processes might avoid including that polyfill file, but you will need to provide polyfills for the likes of Object.assign to avoid the current code breaking.

@brettz9 brettz9 self-assigned this Jan 20, 2017
@brettz9 brettz9 added this to the 3.0.0 milestone Jan 20, 2017
@brettz9 brettz9 added this to Safari/iOS in Browser bugs Feb 16, 2017
@brettz9
Copy link
Collaborator

brettz9 commented May 4, 2017

In #252 (comment) , there were reports that things were working in iOS9 (though there have been further changes since then).

Welcome to try the 3.0.0-rc.3 version out for a spin. Closing as this should be fixed. Feel free to reopen if you find anything to the contrary.

@brettz9 brettz9 closed this as completed May 4, 2017
@brettz9
Copy link
Collaborator

brettz9 commented Dec 1, 2017

For questions about IndexedDB itself, ask somewhere like StackOverflow (or for the plugin, contact the plugin owner). This is for reporting issues with IndexedDBShim, a library to let you use IndexedDB on some older browsers (though most recent changes have been oriented toward Node support rather than all older browsers).

@axemclion
Copy link
Collaborator

I request that we acknowledge the good work that @brettz9 is doing with maintaining the project.

@DickvdBrink
Copy link
Collaborator

Agreed, Good job @brettz9 and thanks for all the hard work!

@JamesMessinger
Copy link
Collaborator

Hear! Hear! Maintaining an open source project can seem like thankless work sometimes, but we appreciate all you do, @brettz9. Keep it up

@brettz9
Copy link
Collaborator

brettz9 commented Dec 5, 2017

Thanks a lot, fellas! Thanks for all your good work and reports as well as kind encouragement...

Btw, I expect all of the past contributors to the project ought to enjoy hearing from other folks here who are using the software about how they are putting it to use (and whether you're using 3.*)...

Or if it is for private purposes, just the fact that you're using it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Browser bugs
Safari/iOS
Development

No branches or pull requests

7 participants