taler-typescript-core

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

commit 50476c0adbc48883537fa82893044d1592aaf1fa
parent f3bd7762ad8b0cc5d8940e9539fd997188351839
Author: Florian Dold <florian@dold.me>
Date:   Fri,  1 Aug 2025 16:09:51 +0200

wallet-core: reload shepherd when clearing DB

Diffstat:
Mpackages/taler-wallet-core/src/shepherd.ts | 7+++----
Mpackages/taler-wallet-core/src/wallet.ts | 1+
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts @@ -65,8 +65,8 @@ import { } from "./deposits.js"; import { computeDenomLossTransactionStatus, - processTaskExchangeAutoRefresh, processExchangeKyc, + processTaskExchangeAutoRefresh, updateExchangeFromUrlHandler, } from "./exchanges.js"; import { @@ -278,10 +278,9 @@ export class TaskSchedulerImpl implements TaskScheduler { logger.info(`reloading shepherd with ${tasksIds.length} tasks`); for (const taskId of tasksIds) { this.stopShepherdTask(taskId); + this.sheps.delete(taskId); } - for (const taskId of tasksIds) { - this.startShepherdTask(taskId); - } + await this.loadTasksFromDb(); } private async internalStartShepherdTask(taskId: TaskIdStr): Promise<void> { diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -2208,6 +2208,7 @@ const handlers: { [T in WalletApiOperation]: HandlerWithValidator<T> } = { codec: codecForEmptyObject(), handler: async (wex, req) => { await clearDatabase(wex.db.idbHandle()); + await wex.taskScheduler.reload(); wex.ws.clearAllCaches(); return {}; },