jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.34k stars 357 forks source link

index.count and db.countFromIndex doesnt work in safari #293

Closed dimagoltsman closed 1 year ago

dimagoltsman commented 1 year ago

index.count and db.countFromIndex always returns 0 in safari

jakearchibald commented 1 year ago

Can you create a reduced runnable demo of the bug? (Things like jsbin and glitch are helpful here)

dimagoltsman commented 1 year ago

Can you create a reduced runnable demo of the bug? (Things like jsbin and glitch are helpful here)

Live site: https://glen-large-joke.glitch.me/ Code: https://glitch.com/edit/#!/glen-large-joke

jakearchibald commented 1 year ago

Thanks. This appears to be a Safari bug, and I can't do anything about it.

It doesn't just impact counting, it impacts any operations that get from the store. But, it only seems to happen with array keys/queries that have a single entry. I think this is the bug https://bugs.webkit.org/show_bug.cgi?id=247613

dimagoltsman commented 1 year ago

Thanks. This appears to be a Safari bug, and I can't do anything about it.

It doesn't just impact counting, it impacts any operations that get from the store. But, it only seems to happen with array keys/queries that have a single entry. I think this is the bug https://bugs.webkit.org/show_bug.cgi?id=247613

there is a reason we all hate safari... thanx... ill do my stuff with getAll.filter.length for now.....

jakearchibald commented 1 year ago

Yeah, that seems as good as it gets for a workaround.

Thanks for creating a great demo of the issue btw, sorry it wasn't something I could fix.