taler-typescript-core

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

commit 8fc484375cd2bd3450639c4af83019662c096296
parent faf2520422a0e65810abac7e93c2ea7635d33e94
Author: Florian Dold <dold@taler.net>
Date:   Thu,  3 Sep 2026 16:01:24 +0200

idb-bridge: release the transaction level when a commit fails

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

diff --git a/packages/idb-bridge/src/SqliteBackend.ts b/packages/idb-bridge/src/SqliteBackend.ts @@ -1931,6 +1931,7 @@ export class SqliteBackend implements Backend { if (this.txLevel === TransactionLevel.None) { return; } + try { if (this.txLevel === TransactionLevel.VersionChange) { for (const store of connInfo.storeList) { if (store.currentName == null) { @@ -1969,8 +1970,12 @@ export class SqliteBackend implements Backend { } } await this._commitSqlTransaction(); - this.transactionMap.delete(btx.transactionCookie); - this._releaseTransactionLevel(); + } finally { + // A failed commit must not leave the transaction level held, or + // every later transaction waits forever. + this.transactionMap.delete(btx.transactionCookie); + this._releaseTransactionLevel(); + } } async _provideObjectStore(