taler-typescript-core

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

commit b84d1c761a860d5e80310bb38d2921670ee11ad6
parent 3d79e864dae201983315238c07bed7bf7a0064c7
Author: Florian Dold <florian@dold.me>
Date:   Tue, 29 Apr 2025 15:41:07 +0200

wallet-core: feature flag for bugs.taler.net/n/9812

Diffstat:
Mpackages/taler-wallet-core/src/dev-experiments.ts | 12++++++++++++
Mpackages/taler-wallet-core/src/pay-merchant.ts | 9+++++++++
Mpackages/taler-wallet-core/src/wallet.ts | 3+++
3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/dev-experiments.ts b/packages/taler-wallet-core/src/dev-experiments.ts @@ -168,6 +168,18 @@ export async function applyDevExperiment( throw Error("base_url required"); } wex.ws.devExperimentState.fakeProtoVer?.delete(baseUrl); + return; + } + case "flag-confirm-pay-no-wait": { + const setVal = parsedUri.query?.get("val"); + if (setVal === "0") { + wex.ws.devExperimentState.flagConfirmPayNoWait = false; + } else if (setVal === "1") { + wex.ws.devExperimentState.flagConfirmPayNoWait = true; + } else { + throw Error("param 'val' must be 0 or 1"); + } + return; } } diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts @@ -3014,6 +3014,15 @@ export async function confirmPay( // In case we're sharing the payment and we're long-polling wex.taskScheduler.stopShepherdTask(ctx.taskId); + // This will become the default behavior on the future. + if (wex.ws.devExperimentState.flagConfirmPayNoWait) { + return { + type: ConfirmPayResultType.Pending, + transactionId: transactionId as TransactionIdStr, + lastError: undefined, + }; + } + // Wait until we have completed the first attempt to pay. return waitPaymentResult(wex, proposalId); } diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -2608,6 +2608,9 @@ export interface DevExperimentState { fakeVer: string; } >; + + /** Migration test for confirmPay */ + flagConfirmPayNoWait?: boolean; } export class Cache<T> {