We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f1cb7c commit 9a571f1Copy full SHA for 9a571f1
packages/web/src/db/adapters/wa-sqlite/WASQLiteConnection.ts
@@ -387,7 +387,15 @@ export class WASqliteConnection
387
388
async close() {
389
this.broadcastChannel?.close();
390
- await this.sqliteAPI.close(this.dbP);
+ await this.acquireExecuteLock(async () => {
391
+ /**
392
+ * Running the close operation inside the same execute mutex prevents errors like:
393
+ * ```
394
+ * unable to close due to unfinalized statements or unfinished backups
395
396
+ */
397
+ await this.sqliteAPI.close(this.dbP);
398
+ });
399
}
400
401
async registerOnTableChange(callback: OnTableChangeCallback) {
0 commit comments