Open jakearchibald opened 3 years ago
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.
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.
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 realidbOpenRequest
yet.
Could add an unwrapAsync
to handle this scenario. Is unwrap
commonly used by idb users? 🤔
Seems sad to add a whole new API for a temporary Safari bug.
I suspect unwrap
is rarely used, but I don't know.
Seems sad to add a whole new API for a temporary Safari bug.
I agree with that 😞
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.