Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexedDB should be closed before delete #2685

Open
1 of 3 tasks
puzrin opened this issue Jan 29, 2022 · 0 comments
Open
1 of 3 tasks

IndexedDB should be closed before delete #2685

puzrin opened this issue Jan 29, 2022 · 0 comments

Comments

@puzrin
Copy link

puzrin commented Jan 29, 2022

Type of bug

  • Differences between Can I use & Modernizr
  • False positive
  • Modernizr error

Describe the bug

detectDeleteDatabase(indexeddb, testDBName);

IndexedDB should be closed before delete. In other case delete request is postponed until page close.

req.result.close should help. I'm not sure about previous place (how to get opened connection there)

How to Reproduce

Difficult to show with existing code, because Modernized does not wait for result of delete. But in other, implementation, if you wait for result, code will hand on opened database https://github.com/nodeca/bkv/blob/master/src/idb_storage.mjs#L56. Need comment from someone experienced with IndexedDB, why that branch exists at all.

Expected behavior

Testing DB should be deleted immediately.

Additional context

Also, not sure why Modernizr creates random db on every use. If db already exists, that's probably "success".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant