You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like an optimal solution would be to find a way to use SQL lite across electron and cordova. This may require writing our own plugin for cordova. Cordova plugin is here: https://github.com/storesafe/cordova-sqlite-storage
I did some investigation on this, and I'm not sure a persist plugin is what we need if the store is getting too large.
What might work well is some custom redux middleware which sideloads the sqlite data as and when it's needed - something like the following perhaps?:
constsessionsStore=store=>next=>action=>{switch(action.type){case'persist/REHYDRATE':
// inject session from sqlite if an active sessionIdcase'SET_SESSION':
// load session from storecase'END_SESSION':
// save session to dbdefault:
returnnext(action);}};
We need to use appropriate storage adaptors for
redux-persist
because localStorage can be erased at any time by the OS, and has varied limits across platforms: https://cordova.apache.org/docs/en/latest/cordova/storage/storage.htmlThis will lead to sudden spontaneous data loss.
It is also very slow (serialize/deserialize) and has limits on what it can represent.
Existing adapter options are listed on the redux-persist repo: https://github.com/rt2zz/redux-persist
It looks like an optimal solution would be to find a way to use SQL lite across electron and cordova. This may require writing our own plugin for cordova. Cordova plugin is here: https://github.com/storesafe/cordova-sqlite-storage
Potential plugin already developed here: https://github.com/sumedh22/redux-persist-cordova-sqlite#readme
IndexedDB, localStorage, localForage, and web SQL are all not appropriate, since they are also susceptible to OS deletion on iOS.
This relates to #1066, and will ideally contribute to solving it. For example, we might choose to put each session in its own SQL lite database.
The text was updated successfully, but these errors were encountered: