-
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
localForage 1.5: IndexedDB not available anymore in iOS <10.3 despite installed base due to 1.4.3 bug #676
Comments
According to #604 #650 #651 we added support for IndexedDB in Safari 10.1+ in LF v1.5. Lastly, you might want to use localForage-cordovaSQLiteDriver in your implementation. |
I was also surprised that IndexedDB is used. I'm using now localForage-cordovaSQLiteDriver but for the migration to it, I want to read the data from the IndexedDB. |
That's really strange and I'm not sure how I can help you. |
I updated the first post, please take another look on it. You can verify this conveniently in the iOS Simulator for the different iOS versions. The iOS Simulator ships with Xcode. No fiddling with different devices needed, just a Mac. |
Can you also post the navigator agent strings that the two iOS emulators report? |
|
Here is a jsbin with my findings (using the user agent strings that you shared). Please run it on webkit, so that websql is also available.
You are right that iOS 9.3 is detected as capable of IndexedDB, but since safari < 10.2 had a buggy IndexedDB implementation we tried to avoid it. PS: a hacky workaround to re-enable IndexedDB on iOS < 10.2 with localforage v1.5 on your responsibility, would/could be to:
|
I feel like reverting back to the old storage engine is worth doing if the bugs iOS Safari encounters are bad. I figured they should both be supported, darn. From my understanding we should only support indexeddb on desktop safari for now?
|
I think that IndexedDB works both on desktop and iOS safari 10.2 but in neither environments before 10.2 . Could we possibly create a configuration option to set |
How about creating a custom driver that inherits WebSql but uses the old detection and only runs on safari? That way we could have a clear upgrade path like:
|
That works for me, sounds good. 👍🏻
|
@denis1994 & @tofumatt How would you feel for a compatibility plugin with the following api: var driverPreferenceOrder = [
localforage.INDEXEDDB,
localforage.WEBSQL,
localforage.LOCALSTORAGE
];
localforageCompatibility1_4.config().then(function() {
localforage.config({
driver: driverPreferenceOrder
});
// or
// return localforage.setDriver(driverPreferenceOrder);
}).then(function() {
// your LF code here
}); |
That works for me, should make it easy for folks to create a new instance and transfer their data over 👍 |
Happy to hear that. I will need a review on #723 for this and we can probably release it as 1.5.1 |
@denis1994 localForage-compatibility-1-4 was just released to resolve this issue. Please check it out, I hope that you will like it. |
bug: localForage 1.4.3 enables AsyncStorage (IndexedDB) on iOS 10
The default storage changes from WebSQL to AsyncStorage (IndexedDB) on upgrading from iOS 9 to iOS 10 with localForage 1.4.3.
This seems to be a bug - as this behavior has now been 'fixed' with #651
problem: actual users using IndexedDB in iOS 10, 10.1 & 10.2 can't access their data anymore with localForage 1.5
we have now users in our installed base who actually use this IndexedDB in iOS 10 - below the Safari 10.1 (i.e., without the reworked IndexedDB2.0 in Safari 10.1, which gets released with iOS 10.3).
However, localForage 1.5 disables using the IndexedDB on iOS <10.3 (Safari <10.1), i.e., we can't access that previously already used storage option
reverting to 1.4.3 is not an option, as we need to use localForage 1.5 to have the correct behaviour to new users
request for solution: re-enable IndexedDB for Safari < 10.1 (as option with warnings)
--> Request: re-enable IndexedDB for Safari < 10.1 in localForage 1.5 with an option (and some warning to not use this)
This would enable us to create a migration back to WebSQL on iOS <10.3 for our installed base users
The text was updated successfully, but these errors were encountered: