Chrome on Android: Granted Quota for IndexedDB suddenly almost 0
Asked Answered
G

2

8

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']
Glutathione answered 25/4, 2018 at 9:58 Comment(4)
Exactly the same here, as a workaround I used sqlite-adapter for pourchdb for a week but now I encounter sqlite bugs while using attachments over pouchdb..Petrify
Also as an "online solution" you can test the storage at first and in case of failure work only with the remote database, better to have access to the app online than none at all.Petrify
Also if you can correct your title : granted quota instead of granted quote, I was looking for a long time before I finally found your question. Maybe it can help others.Petrify
@Noelmout Thanks for sharing. I updated the title. I don't use attachments in PouchDb, but good to know. Offline usage is my primary use case, so using the app online isn't really an alternative in my case.Glutathione
T
2

There really is a bug. It was fixed and merged, but it wasn't released yet (https://chromium.googlesource.com/chromium/src/+/73b18e372a83137f1198a350973225c4c145ceb6%5E%21/).

For a serious bug like this one it should be fixed and released almost immediately. There is no other beta release for May and M67 it will be released on May 29th (https://www.chromium.org/developers/calendar).

Telegraphic answered 14/5, 2018 at 19:38 Comment(1)
Thanks for sharing the bugfix. For me, it's too late now. I migrated users to SQLite, because them having no access to their data for 6 weeks is quite unacceptable. I'm still surprised that this bug wasn't discussed more, because it seemed to affect A LOT of people. But maybe not ;)Glutathione
D
3

In the Chrome bug tracker as:

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

Discriminate answered 2/5, 2018 at 19:58 Comment(0)
T
2

There really is a bug. It was fixed and merged, but it wasn't released yet (https://chromium.googlesource.com/chromium/src/+/73b18e372a83137f1198a350973225c4c145ceb6%5E%21/).

For a serious bug like this one it should be fixed and released almost immediately. There is no other beta release for May and M67 it will be released on May 29th (https://www.chromium.org/developers/calendar).

Telegraphic answered 14/5, 2018 at 19:38 Comment(1)
Thanks for sharing the bugfix. For me, it's too late now. I migrated users to SQLite, because them having no access to their data for 6 weeks is quite unacceptable. I'm still surprised that this bug wasn't discussed more, because it seemed to affect A LOT of people. But maybe not ;)Glutathione

© 2022 - 2024 — McMap. All rights reserved.