taler-typescript-core

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

commit 2c86c9a164dfc54ce2f2bfb5c17ef09869eb963e
parent 935ae63779b136e5f7c580d38cf9aee13bb7890e
Author: Florian Dold <dold@taler.net>
Date:   Wed, 22 Jul 2026 10:51:17 +0200

wallet: run sqlite commit hooks before delivering notifications

The IndexedDB backend runs them in that order, so a transaction that both
notifies and schedules a commit hook behaved differently on the two backends.

Diffstat:
Mpackages/taler-wallet-core/src/dbtx-sqlite.ts | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/packages/taler-wallet-core/src/dbtx-sqlite.ts b/packages/taler-wallet-core/src/dbtx-sqlite.ts @@ -5061,12 +5061,14 @@ async function runNativeSqliteWalletTxLocked<T>( } await ndb.txc.commit(); await checkpointIfIdle(ndb); - for (const notif of tx.pendingNotifications) { - notifyFn(notif); - } + // Same order as the IndexedDB backend: the handlers run before a client + // can observe the notification. for (const h of tx.afterCommitHandlers) { h(); } + for (const notif of tx.pendingNotifications) { + notifyFn(notif); + } return res; }