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

Dexie.js not working in "Chrome and Opera for iOS" #110

Open
mtblabs opened this issue Jun 17, 2015 · 14 comments
Open

Dexie.js not working in "Chrome and Opera for iOS" #110

mtblabs opened this issue Jun 17, 2015 · 14 comments

Comments

@mtblabs
Copy link

mtblabs commented Jun 17, 2015

I tested this in iOS 8.
Dexie is working in Safari for iOS 8.

@aaron-schmidt
Copy link

Chrome and Opera do not support IndexedDB in iOS8:
http://stackoverflow.com/questions/16125199/indexeddb-in-chrome-on-ios-when-available

@dfahlander
Copy link
Collaborator

Ok, thanks for that important information. I suppose there's nothing we could do about it though? ;(

@mtblabs
Copy link
Author

mtblabs commented Jun 17, 2015

I don't think so.
The app / dexie is working without any problem in "safari for iOS 8"... so if "Chrome for iOS" really is based on the Safari engine it should also work.
Also the lib "YDN-DB" is working without any problem.
So for me it looks like there is an issue in the Dexie implementation. Your "Algorithms example" says: "Database not open. IndexedDB API not found...". Probably the detection of the API is handled different in Chrome as in Safari??

@dfahlander
Copy link
Collaborator

Unless the iOS web browser control lacks indexedDB even though Safari has it. Does YDN-DB work without the indexedDB shim for WebSQL or does it include it first?

When Dexie throws "...IndexedDB API not found", it means it didnt find any of the following:

window.idbModules.shimIndexedDB
window.indexedDB
window.mozIndexedDB
window.webkitIndexedDB
window.msIndexedDB

So where is indexedDB in that case?

Could it be that YDN-DB works with the IDB-shim only? If so, could you test to include the shim before including Dexie?

@mtblabs
Copy link
Author

mtblabs commented Jun 17, 2015

Using the latest IDB-shim before dexie.js does work in a simple test.
Now I'm struggle in my app with the combination of IDB-shim / dexie.js as commonJS module / react.js... but this shoulden't be a problem of dexie.

@dfahlander
Copy link
Collaborator

Ok, nice. Suppose the shim must be included as a plain script tag but Dexie should pick it up even though included as a commonJS module. Haven't tested that so please tell me if it works or not.

@mtblabs
Copy link
Author

mtblabs commented Jun 17, 2015

looks like it's not so easy... probably the shim as some issues... including the shim breaks now the function of Firefox... I'll come back to you if I have a version that works...

@mtblabs
Copy link
Author

mtblabs commented Jun 18, 2015

So, it's working with the following implementation tested in "Chrome, Safari, Opera (all iOS 8.1), Firefox, IE 11, Chrome (all Win 7), Firefox, Chrome, Safari (latest Mac OS X)". Android should also work, but I have no such devices...

What have I done:

  • load the IndexedDBShim.js as first (plain) script for all browsers EXCEPT Firefox and IE
  • load dexie.js afterwards (makes no difference if it 's loaded as plain script or as a commonJS module)

Hope this helps. Probably you're able to optimize this behavior in dexie...

@dfahlander
Copy link
Collaborator

Thanks for reporting how you found your way to fix this. I still don't see how this could be optimized within dexie. From what I understand, the issue is on IOS devices that lacks indexedDB support. What would dexie be supposed to do then? Please explain your idea of what dexie could do here to simplify/optimize this. Do you suggest dexie should bundle the shim so that it works "out of the box" without having to include the shim in a script tag?

@mtblabs
Copy link
Author

mtblabs commented Jun 25, 2015

Good question. Indexeddb is supported in iOS 8+, but seems to be faulty. You'll find the master bugs here: https://gist.github.com/nolanlawson/08eb857c6b17a30c1b26
Probably one of this bugs will Dexie stop working on iOS. Perhaps you're able to fix it on Dexie so no shim is required anymore. If not, then we have to live for the moment with the shim workaround.

@dfahlander
Copy link
Collaborator

The worst issues with indexedDB on Safari 8 (web browser) has already been worked around in Dexie (onupgradeneeded error and no support for multiple object stores). This has been verified to work with Safari 8 and Dexie as long as you only use a single object store per transaction. So I suppose the issues you detected is specific to chrome / opera on IOS.

Sine I don't have access to any IOS device I can't see what's happening. You helped me and pointed out that Dexie claims "indexedDB API not found" which indicates that the indexedDB API is actually missing for those browsers on IOS. Maybe they use an earlier version of the Web browser component that lacks indexedDB support, and in that case, the only thing to do is to wait for a newer version of chrome for IOS, and in the meantime use the WebSQL polyfill?

@mtblabs
Copy link
Author

mtblabs commented Jun 25, 2015

Currently we are working on the implementation of our web app and so far it's working with the workaround descripted above. If we'll found more issues, we'll come back to you and open a new issue on the Dexie Git.

@peteruithoven
Copy link

@mtblabs Could you clarify whether you use .__useShim()? Have you been able to test this on Android devices in the meantime?

@mohshraim
Copy link

Working normally on Mac Safari 11.1
But indexedDB have big problem on iOS (Safari and Chrome); that Application Data size keep increasing and never cleared.
https://bugs.webkit.org/show_bug.cgi?id=178204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants