Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome on Android: Granted Quota for IndexedDB suddenly almost 0

Was there recently a change in Android Chrome's quota management for IndexedDB? I'm using PouchDB with adapter IndexedDB in an Ionic 3 Cordova app. It went pretty smooth for the last 6 months. But within the last 5 days, I received a significant increase in complaints about data not loading correctly in the app. My app requires only 3-4 MB of data. Here's what I know so far:

  • Problem only occurs in situations with low disk space on the internal storage (even if the app is installed on an SD card)
  • Affected devices almost always have only 16GB of internal disk space and seem to be constantly full
  • Freeing disk space resolves the problem
  • There seems to be a sharp cut-off for the granted quota for IndexedDB when the device runs below 150-250MB or so. If an additional 100-200MB are freed, the granted quota suddenly jumps up to 50MB or more
  • It seems that there was a recent change to either Chrome or Android that introduced this problem, because my app didn't receive an update recently and it even affects new users with only a few KB of data.

I also suspected that maybe people took more photos in the last days, because the weather was pretty good, resulting in less free disk space and thus, a spike in reported errors. But I'd still find this an odd explanation.

Anyone else noticed similar problems in their apps? Any solutions besides switching to Cordova-SQLite?

Update 2018-05-03:

I figured a few more things:

  • Devices almost always require more an 1 GB of free internal storage. 500MB isn't enough anymore
  • If you plan to move to SQLite with PouchDB, read the comments of this question. There might be problems with attachments.
  • If you're using Ionic Storage (based on LocalForage), it will automatically switch to SQLite after you installed the plugin. In my case, this resulted in database errors and I had to switch drivers for Ionic's Storage: driverOrder: ['localstorage', 'indexeddb', 'sqlite', 'websql']
like image 444
ntaso Avatar asked Apr 25 '18 09:04

ntaso


1 Answers

In the Chrome bug tracker as:

https://bugs.chromium.org/p/chromium/issues/detail?id=838816

like image 98
Joshua Bell Avatar answered Nov 10 '22 01:11

Joshua Bell