taler-typescript-core

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

commit 4eb724cd4e897b7157cbaf72c7eb0585d550d30a
parent 316c43a169bd52c8dcdfb9a3894e66b9c650ca85
Author: Florian Dold <florian@dold.me>
Date:   Mon,  1 Jul 2024 14:39:07 +0200

logging, clear cache after updating DB

Diffstat:
Mpackages/taler-util/src/http-impl.qtart.ts | 2+-
Mpackages/taler-wallet-core/src/db.ts | 2++
Mpackages/taler-wallet-core/src/wallet.ts | 2+-
3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts @@ -72,7 +72,7 @@ export class HttpLibImpl implements HttpRequestLibrary { async fetch(url: string, opt?: HttpRequestOptions): Promise<HttpResponse> { const method = (opt?.method ?? "GET").toUpperCase(); - logger.trace(`Requesting (Hi Marc) ${method} ${url}`); + logger.trace(`Requesting ${method} ${url}`); const parsedUrl = new URL(url); if (this.throttlingEnabled && this.throttle.applyThrottle(url)) { diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts @@ -63,6 +63,7 @@ import { WireInfo, WithdrawalExchangeAccountDetails, codecForAny, + j2s, stringifyScopeInfo, } from "@gnu-taler/taler-util"; import { DbRetryInfo, TaskIdentifiers } from "./common.js"; @@ -3220,6 +3221,7 @@ export function clearDatabase(db: IDBDatabase): Promise<void> { for (let i = 0; i < db.objectStoreNames.length; i++) { stores.push(db.objectStoreNames[i]); } + logger.info(`clearing object stores: ${j2s(stores)}`); const tx = db.transaction(stores, "readwrite"); for (const store of stores) { tx.objectStore(store).clear(); diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -1828,8 +1828,8 @@ async function dispatchRequestInternal( return await wex.cryptoApi.hashString({ str: "hello world" }); } case WalletApiOperation.ClearDb: { - wex.ws.clearAllCaches(); await clearDatabase(wex.db.idbHandle()); + wex.ws.clearAllCaches(); return {}; } case WalletApiOperation.Recycle: {