5 ms·
I was bit by this in a cordova app on a past update. After that I backed up api keys, etc to native storage using a cordova plugin and added a wrapper that wil
by low_key 7y ago
I was bit by this in a cordova app on a past update. After that I backed up api keys, etc to native storage using a cordova plugin and added a wrapper that will fall back to it if localstorage lookups fail.
I would advise others to do the something similar since unless you are packaging the browser too (like crosswalk did), then that piece is really out of your control and you shouldn't expect it to be retained.
A similar issue can be seen on iOS under low storage conditions where the operating system will clear the browser cache to reclaim space.
- webappguy 7y agoWhich plugin?
- martin_bech 7y agoIf would guess the cordova sqlite plugin
- low_key 7y agoThis plugin has worked reliably on both Android and iOS and has a simple api: https://github.com/TheCocoaProject/cordova-plugin-nativestorage https://github.com/TheCocoaProject/cordova-plugin-nativestor...
- traspler 7y agoI can only recommend you switch fully to SQLite or native storage. localStorage has always been unreliable and could be cleared any time on iOS.
- the_gipsy 7y ago> a wrapper that will fall back to it if localstorage lookups fail. If I understand correctly, the scenario is that saved data in localStorage is lost, so that won't help.
- makeramen 7y ago“It” in this case is native storage, not localStorage
- the_gipsy 7y agoYes, that was clear. You say it uses localstorage, and only fallback to native when localstorage is not available. This is not the scenario of the bug. Here, localstorage is available, it just has been wiped out.
- low_key 7y agoNative storage protects against this scenario, though. It isn't safe to assume that localstorage will be retained.