Ionic Webview Update causes storage loss


#1

I have an Ionic3 app that has been in production mode in the store for almost a year. An update from cordova-plugin-ionic-webview to version 2.3.1 and UseScheme="true" improves the performance enormously! However, the whole storage is deleted. This is really fatal for an app in production mode.

What can I do to keep or transfer the data in the storage?

What I tried

I tried with plugin cordova-plugin-ionic-migrate-localstorage but does not work, maybe because my cordova-plugin-ionic-webview version is too new for this plugin.


#2

Do you mean continuosly deleting it with every reboot of the application OR when you upgrade your webview from whatever was there before?

If it’s the latter that is expected behaviour. You would preferably need to store that persistent data to file storage or sqllite so there might need to be an interim release to do exactly that. Then when you either leave that data in that location forever more, or migrate it back after, but I would recommend leaving it there forever.


#3

Thank you very much. Without an intermediate update there is no more fluid possibility? In this case I have to solve it like this, yes.

And what about sessions that are noticed in the cache? There are no controlled storage entries. Is it somehow possible to remember the user’s login when user opens the app?


#4

Are you storing SQL-like data or Key-Value type stuff?


#5

Key-Value type stuff :wink: Really boring! :smiley:


#6

That would be a prime-candidate to be injected into storage…

Don’t threat at the mention of sqlite @ the top of that webpage - it will still hold the key values. And it’ll hold them in a much more persistent storage mechanism that lives outside the webview.


#7

I already use storage from ionic-native. Nevertheless the storage is completely emptied during the webview update. But only if I set “UseScheme” to “true”. So the only solution would be an interim release who I´ll inject the data from storage to sqllite?


#8

If that’s the case I’m guessing the cordova-sqlite-storage plugin is not available so the native wrapper is defaulting back to the webview’s storage.

Can you check that out?


#9

Here’s a fork for Ionic WebView v4
https://github.com/benjamineberle/cordova-plugin-migrate-localstorage