Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wild-pants-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/wa-sqlite': patch
---

Clear retryOps after waiting for ops. This can fix issues on OPFSCoopSyncVFS where is an access handle failed to be obtained once, it could lock the entire connection indefinitely.
7 changes: 5 additions & 2 deletions src/sqlite-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,11 @@ export function Factory(Module) {
// Wait for all pending retry operations to complete. This is
// normally empty on the first loop iteration.
if (Module.retryOps.length) {
await Promise.all(Module.retryOps);
Module.retryOps = [];
try {
await Promise.all(Module.retryOps);
} finally {
Module.retryOps = [];
}
}

rc = await f();
Expand Down