diff --git a/.changeset/wild-pants-shave.md b/.changeset/wild-pants-shave.md new file mode 100644 index 00000000..dd8a1427 --- /dev/null +++ b/.changeset/wild-pants-shave.md @@ -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. diff --git a/src/sqlite-api.js b/src/sqlite-api.js index 935383eb..6e75e853 100644 --- a/src/sqlite-api.js +++ b/src/sqlite-api.js @@ -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();