taler-typescript-core

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

commit e5b9c1b7e306ade9895f21eea18eb9253783901e
parent 76e3a3fc04bacd8a491098b827e026bd4009497b
Author: Florian Dold <dold@taler.net>
Date:   Wed, 22 Jul 2026 10:46:31 +0200

wallet: keep the work item when a worker response does not match

The item was detached from the worker before its rpc id was checked, so a
message with an unexpected id left the caller waiting forever and kept the
worker counted as busy.

Diffstat:
Mpackages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.ts | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/packages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.ts b/packages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.ts @@ -259,15 +259,17 @@ export class CryptoDispatcher { return; } const currentWorkItem = ws.currentWorkItem; - ws.currentWorkItem = null; if (!currentWorkItem) { logger.error("unsolicited response from worker"); return; } if (id !== currentWorkItem.rpcId) { + // Ignore the message and keep waiting for the response that belongs to + // the work item the worker is running. logger.error(`RPC with id ${id} has no registry entry`); return; } + ws.currentWorkItem = null; if (currentWorkItem.state === WorkItemState.Running) { this.numBusy--; currentWorkItem.state = WorkItemState.Finished;