Accessing IndexedDB in iOS / iPadOS 14.6

Since updating my iPad to 14.6, I see huge problems opening a connection to the IndexedDB. This can be seen in our hybrid app and in the Safari Browser directly.

When the app starts, it fails connecting to the database. But when I reload the page afterwards, everything works fine.

Hey Apple,

after doing some more testing and investigation, it pretty much looks as if the IndexedDB support is some kind of lazy-loaded module, and the loading is somehow buggy. I now added a line to access window.indexeddb very early in the bootstrapping of the app, so that it is ready when needed by the "real" code afterwards.

Still not perfect, by a workaround solution for the moment.

Hello. Yes, i have this problem in webview too.

Minimal reproduce code

var request = indexedDB.open("MyTestDatabase", 10);
request.onerror = function(event) {
  console.log('error')
};
request.onsuccess = function(event) {
  console.log('succes')
};

result - empty console. Even after 10 seconds

if i add timeout before openDb, like this

const db = window.indexedDB;
setTimeout(() => {
    var request = db.open('MyTestDatabase', 10);
    request.onerror = function(event) {
       console.log('error')
    };
    request.onsuccess = function(event) {
       console.log('success')
    };
}, 1000);

Can see 'success' in dev console

Did someone test this on iOS 14.7? I have the same issue using nuxt.js in Browser. On iPadOS 15, I can not see any problems with that.

Has this been reported to the webkit team?

It worked for me when I declared the DB when the page loads.

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8" />
  <script type="text/javascript">
     window.indexedDB;
  </script>

I seem to be having the same/similar issue on iOS safari 15.

Accessing IndexedDB in iOS / iPadOS 14.6
 
 
Q