-
Notifications
You must be signed in to change notification settings - Fork 100
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
Storage cleared everytime the app closes/on refresh #165
Comments
I actually have the same problem! I notice that the cordova-sqlite-storage has an option to set androidLockWorkaround: 1 in the config setting. I tried setting that in the config like this
but it was giving me an error saying StorageConfig does not have androidLockWorkaround Can anyone please verify. Thank you. |
@jcbriones
|
Hi @YogliB @jcbriones, I've got the same issue. I don't recall this being the case with the previous Have you managed to find a fix? |
@Taylorsuk Nope, just stopped using it... |
@YogliB I am facing the same issue what alternative have you used if not using this ? |
I am also facing this issue. |
We've moved on to developing PWAs, so now I just use LocalForage. |
I'm having this issue as well, anyone find anything new? |
Same problem here. On 'device platforms' (ios/android) works fine but on 'browser' platform the storage is clear every app startup or reload. However without reload or restart works fine. this is my env:
compiled with And upload www folder to AWS Some solution or workaround? Someone managed with this? |
Not sure why this would happen, perhaps a browser config issue? About to release v3 in a few weeks so hopefully it addresses this. |
Still happening on 3.0.4 / Ionic 5.4.16 UPDATE: Found out that this happens when available space is low. Browser gets rid of temporary storage when lacking space. https://developer.chrome.com/docs/apps/offline_storage/#table |
@argvil19 do you have some kind of workaround? I encounter this problem with @ionic/[email protected]. We are using Ionic Appflow Live Updates. This Bug causes the App to logout on old android devices. If you shutdown the App and reopen it afterwards, you are logged in again, because the storage is loaded correctly. At the moment I#'m experimenting with saving the data from the storage in a file and reload this file, if the storage is empty. We are Using the following Drivers:
|
@aaronbach we have the same problem :( did you find a workaround? |
@elreco yes and no. We have implemented a step before every Appflow Update, which persists the whole ionic storage to a json file and tries to reloads it everytime you are on the login route. the workaround caused additional troubles, so we decided to switch off AppFlow Updates on Android. |
@aaronbach thank you so much for your answer! You are right, and appflow updates are very fast on iOS. Do you think that it can works better if we use a sqlite plugin without the ionic storage package? Like using this: https://ionicframework.com/docs/native/sqlite and make manual sql queries to save our persistent data? |
@elreco when you only need storage in a mobile app, it should be worth trying: |
I'm using
@ionic/storage
v2.2.0 with Ionic v4 and Angular v7, and in development mode, the storage (IndexedDB in that case) is cleared on refreshing the page.On mobile (with Cordova on Android v7.1.4), the storage is cleared upon closing the app.
I use NO extra settings in my app for the storage and used it just like the instructions here (I installed the npm package and the Cordova plugin).
The text was updated successfully, but these errors were encountered: