aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/deposits.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/deposits.ts')
-rw-r--r--packages/taler-wallet-core/src/deposits.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/deposits.ts b/packages/taler-wallet-core/src/deposits.ts
index b327632d3..f532dc136 100644
--- a/packages/taler-wallet-core/src/deposits.ts
+++ b/packages/taler-wallet-core/src/deposits.ts
@@ -738,7 +738,7 @@ async function transitionToKycRequired(
async function processDepositGroupPendingTrack(
ws: InternalWalletState,
depositGroup: DepositGroupRecord,
- cancellationToken?: CancellationToken,
+ cancellationToken: CancellationToken,
): Promise<TaskRunResult> {
const { depositGroupId } = depositGroup;
for (let i = 0; i < depositGroup.statusPerCoin.length; i++) {
@@ -767,6 +767,7 @@ async function processDepositGroupPendingTrack(
depositGroup,
coinPub,
exchangeBaseUrl,
+ cancellationToken,
);
if (track.type === "accepted") {
@@ -888,8 +889,7 @@ async function processDepositGroupPendingTrack(
});
return TaskRunResult.finished();
} else {
- // FIXME: Use long-polling.
- return TaskRunResult.backoff();
+ return TaskRunResult.longpollReturnedPending();
}
}
@@ -1115,6 +1115,7 @@ async function trackDeposit(
depositGroup: DepositGroupRecord,
coinPub: string,
exchangeUrl: string,
+ cancellationToken: CancellationToken,
): Promise<TrackTransaction> {
const wireHash = hashWire(
depositGroup.wire.payto_uri,
@@ -1133,7 +1134,11 @@ async function trackDeposit(
wireHash,
});
url.searchParams.set("merchant_sig", sigResp.sig);
- const httpResp = await ws.http.fetch(url.href, { method: "GET" });
+ url.searchParams.set("timeout_ms", "30000");
+ const httpResp = await ws.http.fetch(url.href, {
+ method: "GET",
+ cancellationToken,
+ });
logger.trace(`deposits response status: ${httpResp.status}`);
switch (httpResp.status) {
case HttpStatusCode.Accepted: {