nolanlawson / emoji-picker-element

A lightweight emoji picker for the modern web
https://nolanlawson.github.io/emoji-picker-element/
Apache License 2.0
1.47k stars 83 forks source link

IDB InvalidStateError due to timing issues with lazy-updates in database #407

Open nolanlawson opened 7 months ago

nolanlawson commented 7 months ago

It's possible to get IDB (or at least fake-indexeddb) to throw this error:

InvalidStateError: An operation was called on an object on which it is not allowed
or at a time when it is not allowed. Also occurs if a request is made on a source
object that has been deleted or removed. Use TransactionInactiveError or
ReadOnlyError when possible, as they are more specific variations of InvalidStateError.

I have a repro forthcoming; it's in the unit tests.

nolanlawson commented 7 months ago

Repro: comment out this line:

https://github.com/nolanlawson/emoji-picker-element/blob/2a57ba18e8b670dd02bee9a6fc8a1cc2632bf13d/test/spec/database/Database.test.js#L156