I’m happy to see this post (well, not happy for your problems, but happy that I’m not the only person facing this issue). I posted this a few days ago: Compatible Data Storage: Is it this hard?
To address your Qs:
-
I found that on some Android phones, IndexDB configuration worked, but setItem failed. One reported phone was a Huawei phone running Android 7, while the other was a Samsung Note running android 5.x - so its not really “legacy phones only” Both phones had 800MB+ of free storage. Its interesting you got a
QuotaExceeded
error. In my case, the error handler simply returned an empty response. It was also interesting to see your available space experiments - given my issues occurred with phones that I don’t own (reported by non-technical users) it was not possible for me to debug deeper beyond a point. There may be something to your conclusion: a threshold for available space is what is causing it -
I found that on some Android phones, trying to save a large data blob in SQLite via local forage caused the phone to freeze
-
Bottom line, I found data store to be somewhat of a mess if you have an app that is widely deployed
I finally reverted to a strategy of trying an actual setItem/getItem
that tried to test the selected storage every time the app ran and if it failed, fell back to another medium. You’d think this is what local forage’s setDriver
should do with an array of DB order, but it seems to have no problem configuring a medium that doesn’t really work in practice. I do fear a situation where its possible in some random run, the test indicates that a proper medium is invalid due to some odd issue, but so far it seems to be holding on.
My app is ionic- v1, but this doesn’t really matter. The core problem is the same.