Ad

IndexedDB.open() Takes Around 10sec On IOS Safari

I have an indexedDB database used in a web app on my iPhone. Lately it started to take more time to start. After diagnosing this case for some time I've found that it happens because of indexedDB.open() running for 10+ seconds.

Here is a little code example

var db;
var promise = utils.promise();
var openRequest = indexedDB.open(this.dbName, this.version);

openRequest.onsuccess = function(evt) {
    db = openRequest.result;
    promise.resolve();
};

openRequest.onerror = function(evt) {
    promise.reject();
    onError(evt, 'Database open');
};

Database itself didn't change lately so much. Also I don't have lots of data. It has around 300 records.

Any idea how to diagnose such an issue?

UPD may be related https://bugs.chromium.org/p/chromium/issues/detail?id=402980

Ad

Answer

Apparently it was a result of iOS update (from 11.1.* to 11.2.*).

I have my web app added to the Home Screen. And as far as I understand when you do iOS updates the web app container is moved to a new iOS environment but conserves some features from the original iOS version (probably something related to WebView used for web app but I am not sure).

So I have added my web app to Home Screen again and it starts without delays.

Ad
source: stackoverflow.com
Ad