Closed bgerm closed 4 years ago
Expected: terminated to be called when an IndexedDB database is manually deleted (with terminated configured)
terminated
Result: terminated does not get called.
It appears close is being set up as an addEventListener for the IDBOpenDBRequest object, but the docs show this fires for the IDBDatabase object.
close
IDBOpenDBRequest
IDBDatabase
I think the change should be something like:
if (terminated || blocking) openPromise .then(db => { if (terminated) db.addEventListener('close', terminated) if (blocking) db.addEventListener('versionchange', blocking) }) .catch(() => { });
Current:
if (terminated) request.addEventListener('close', () => terminated()); if (blocking) { openPromise .then(db => db.addEventListener('versionchange', blocking)) .catch(() => { }); }
Thanks for this library.
Published as 5.0.2. Thanks for spotting this!
Expected:
terminated
to be called when an IndexedDB database is manually deleted (withterminated
configured)Result:
terminated
does not get called.It appears
close
is being set up as an addEventListener for theIDBOpenDBRequest
object, but the docs show this fires for theIDBDatabase
object.I think the change should be something like:
Current:
Thanks for this library.