taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit dbcc79e74e2d057595bd036b8f002f196f90d4f6
parent 780a08233351b1ecb108289b919fae4772f49de8
Author: Florian Dold <florian@dold.me>
Date:   Fri, 13 Jun 2025 00:07:22 +0200

idb-bridge: wait until no transaction is active before exporting

Diffstat:
Mpackages/idb-bridge/src/SqliteBackend.ts | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/packages/idb-bridge/src/SqliteBackend.ts b/packages/idb-bridge/src/SqliteBackend.ts @@ -2122,10 +2122,17 @@ export class SqliteBackend implements Backend { } async backupToFile(path: string): Promise<void> { + // Wait until no other transaction is active. + while (this.txLevel !== TransactionLevel.None) { + await this.transactionDoneCond.wait(); + } + this.txLevel = TransactionLevel.VersionChange; const stmt = await this._prep("VACUUM INTO $filename;"); await stmt.run({ filename: path, }); + this.txLevel = TransactionLevel.None; + this.transactionDoneCond.trigger(); } }