wallet-core: fix long-polling check

This commit is contained in:
Florian Dold 2023-06-06 15:23:25 +02:00
parent e06795debd
commit 265d88b6b7
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -365,6 +365,7 @@ async function processPeerPushDebitReady(
peerPushInitiation.exchangeBaseUrl,
);
mergeUrl.searchParams.set("timeout_ms", "30000");
logger.info(`long-polling on purse status at ${mergeUrl.href}`);
const resp = await ws.http.fetch(mergeUrl.href, {
// timeout: getReserveRequestTimeout(withdrawalGroup),
cancellationToken: ct,
@ -374,7 +375,8 @@ async function processPeerPushDebitReady(
resp,
codecForExchangePurseStatus(),
);
if (purseStatus.deposit_timestamp) {
logger.info(`got purse status ${purseStatus}`);
if (purseStatus.merge_timestamp) {
await transitionPeerPushDebitTransaction(
ws,
peerPushInitiation.pursePub,