idb icon indicating copy to clipboard operation
idb copied to clipboard

Safari iOS/iPadOS 14.6 Bug: First Attempt at Opening indexedDB gets stuck

Open jakearchibald opened this issue 4 years ago • 5 comments

Same issue as https://github.com/jakearchibald/idb-keyval/issues/120.

I'm trying to get more details on this. If second-connection always works, I'll add it in. I'm not sure what to do if the second connection is still a race.

jakearchibald avatar Jun 16 '21 11:06 jakearchibald

Here's a little library that works around this bug https://www.npmjs.com/package/safari-14-idb-fix.

I haven't figured out how to integrate it here yet.

jakearchibald avatar Jun 17 '21 16:06 jakearchibald

The main problem here is:

import { openDB, unwrap } from 'idb';

const openPromise = openDB(...args);
const idbOpenRequest = unwrap(openPromise);

I can't introduce a 'wait' into openDB without breaking the unwrap case, since I won't have the real idbOpenRequest yet.

jakearchibald avatar Jun 18 '21 10:06 jakearchibald

The main problem here is:

import { openDB, unwrap } from 'idb';

const openPromise = openDB(...args);
const idbOpenRequest = unwrap(openPromise);

I can't introduce a 'wait' into openDB without breaking the unwrap case, since I won't have the real idbOpenRequest yet.

Could add an unwrapAsync to handle this scenario. Is unwrap commonly used by idb users? 🤔

runofthemillgeek avatar Jun 18 '21 17:06 runofthemillgeek

Seems sad to add a whole new API for a temporary Safari bug.

I suspect unwrap is rarely used, but I don't know.

jakearchibald avatar Jun 18 '21 17:06 jakearchibald

Seems sad to add a whole new API for a temporary Safari bug.

I agree with that 😞

runofthemillgeek avatar Jun 18 '21 18:06 runofthemillgeek