Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

bulkAdd error on Safari "Attempt to see if key exists in objectstore without an in-progress transaction"

Open econte-sprig opened this issue 1 year ago • 2 comments

We are intermittently seeing the following error uniquely in Safari when calling bulkAdd.

events.bulkAdd(): 1 of 1 operations failed. Errors: UnknownError: Attempt to see if key exists in objectstore without an in-progress transaction

Our code using dexie is unremarkable and looks like this:

  await replayStorage.events.bulkAdd(events);

It looks to be the same issue as reported in this other project using indexed-db. And their associated fix is here

econte-sprig avatar Nov 22 '23 16:11 econte-sprig

I am also facing the same issue for below user agents

  • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15
  • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.15

Its strange that i am doing clear as well before i have used bulkAdd and still i am getting the same error,

hbkrunal avatar Dec 15 '23 13:12 hbkrunal

@econte-sprig, @hbkrunal Is this possibly reproducable? Or does it happen extremely sporadic? Of there's any way to reproduce this - be it running something repro in a loop thousands of times and get the issue randomly, that would also count as some kind of repro. If so, there might be chances I could find a way to workaround it when it happens similarly to how we work around #543 and #613 which occur sporadically in chrome och Safari but we solve it by detecting UnknownError and retry the action

dfahlander avatar Dec 15 '23 15:12 dfahlander