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

BulkError: UnknownError: Attempt to delete range from database without an in-progress transaction #1660

Open
x4AEKx opened this issue Jan 22, 2023 · 4 comments

Comments

@x4AEKx
Copy link

x4AEKx commented Jan 22, 2023

Hello, i got an error at bulkPut(). Tried googling it, didn't help. What does it mean?

await table.bulkPut(entities).catch(Dexie.BulkError, function (e: BulkError) {

// bulkPut(): 160 of 264 operations failed. 
// Errors: UnknownError: Attempt to delete range from database without an in-progress transaction

});
@SalmanAhmedMughal
Copy link

I am also facing the same issue, any solution to this?

@dfahlander
Copy link
Collaborator

Is it only happening in safari?

Got similar issue recently #1829. Check if the user agents listed in this comment are the same as yours: #1829 (comment)

@SalmanAhmedMughal
Copy link

@dfahlander it's happening for me in my ionic app, usually for ios when application is in background.

image
And this issue is coming randomly, i was unable to find the exact steps usually it works.

@dfahlander
Copy link
Collaborator

If it only happens in Ionic on iOS, it might be the webkit engine (Safari) that causes it. I assume that the "in-progress transaction" is somehow lost randomly. Maybe it is triggered when application is put in the background.

In any case, it would be interesting to make a change in dexie that generically catches UnknownError on operations and retries them with a fresh transaction, like we did in PR #1398 to work around the issue with Chrome failing sporadically on creating transactions. Hopefully redoing transaction creation is enough to heal the issue in the background when this happens. If that isn't enough we could also repoen the database and redo the operation. No matter if it is a transactionless operation or an operation within a transaction, we can always retry the transaction since dexie uses a callback for the execution of a transaction block. Even if DB needs to reopen the transaction block can be replayed after reopening the db.

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

3 participants