summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/backup/index.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-06-20 11:40:06 +0200
committerFlorian Dold <florian@dold.me>2023-06-20 11:40:06 +0200
commit9c708251f92e6691ebba80fa8d129c6c04cec618 (patch)
treeedf46c7b3f9386697a4ea697c2d66f66323a6d3e /packages/taler-wallet-core/src/operations/backup/index.ts
parent54f0c82999833132baf83995526025ac56d6fe06 (diff)
downloadwallet-core-9c708251f92e6691ebba80fa8d129c6c04cec618.tar.gz
wallet-core-9c708251f92e6691ebba80fa8d129c6c04cec618.tar.bz2
wallet-core-9c708251f92e6691ebba80fa8d129c6c04cec618.zip
wallet-core: emit DD37 self-transition notifications with errors
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup/index.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/backup/index.ts62
1 files changed, 25 insertions, 37 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/index.ts b/packages/taler-wallet-core/src/operations/backup/index.ts
index f726167da..364e876ec 100644
--- a/packages/taler-wallet-core/src/operations/backup/index.ts
+++ b/packages/taler-wallet-core/src/operations/backup/index.ts
@@ -29,52 +29,52 @@ import {
AmountString,
AttentionType,
BackupRecovery,
+ Codec,
+ DenomKeyType,
+ EddsaKeyPair,
+ HttpStatusCode,
+ Logger,
+ PreparePayResult,
+ PreparePayResultType,
+ RecoveryLoadRequest,
+ RecoveryMergeStrategy,
+ TalerError,
+ TalerErrorCode,
+ TalerErrorDetail,
+ TalerPreciseTimestamp,
+ URL,
+ WalletBackupContentV1,
buildCodecForObject,
buildCodecForUnion,
bytesToString,
- canonicalizeBaseUrl,
canonicalJson,
- Codec,
+ canonicalizeBaseUrl,
codecForAmountString,
codecForBoolean,
codecForConstString,
codecForList,
codecForNumber,
codecForString,
- codecForTalerErrorDetail,
codecOptional,
- ConfirmPayResultType,
decodeCrock,
- DenomKeyType,
durationFromSpec,
eddsaGetPublic,
- EddsaKeyPair,
encodeCrock,
getRandomBytes,
hash,
hashDenomPub,
- HttpStatusCode,
j2s,
kdf,
- Logger,
notEmpty,
- PaymentStatus,
- PreparePayResult,
- PreparePayResultType,
- RecoveryLoadRequest,
- RecoveryMergeStrategy,
- ReserveTransactionType,
rsaBlind,
secretbox,
secretbox_open,
stringToBytes,
- TalerErrorCode,
- TalerErrorDetail,
- TalerProtocolTimestamp,
- TalerPreciseTimestamp,
- URL,
- WalletBackupContentV1,
} from "@gnu-taler/taler-util";
+import {
+ readSuccessResponseJsonOrThrow,
+ readTalerErrorResponse,
+} from "@gnu-taler/taler-util/http";
import { gunzipSync, gzipSync } from "fflate";
import { TalerCryptoInterface } from "../../crypto/cryptoImplementation.js";
import {
@@ -86,29 +86,19 @@ import {
ConfigRecordKey,
WalletBackupConfState,
} from "../../db.js";
-import { TalerError } from "@gnu-taler/taler-util";
import { InternalWalletState } from "../../internal-wallet-state.js";
import { assertUnreachable } from "../../util/assertUnreachable.js";
import {
- readSuccessResponseJsonOrThrow,
- readTalerErrorResponse,
-} from "@gnu-taler/taler-util/http";
-import {
checkDbInvariant,
checkLogicInvariant,
} from "../../util/invariants.js";
+import { addAttentionRequest, removeAttentionRequest } from "../attention.js";
import {
OperationAttemptResult,
OperationAttemptResultType,
TaskIdentifiers,
- scheduleRetryInTx,
-} from "../../util/retries.js";
-import { addAttentionRequest, removeAttentionRequest } from "../attention.js";
-import {
- checkPaymentByProposalId,
- confirmPay,
- preparePayForUri,
-} from "../pay-merchant.js";
+} from "../common.js";
+import { checkPaymentByProposalId, preparePayForUri } from "../pay-merchant.js";
import { exportBackup } from "./export.js";
import { BackupCryptoPrecomputedData, importBackup } from "./import.js";
import { getWalletBackupState, provideBackupState } from "./state.js";
@@ -380,8 +370,6 @@ async function runBackupCycleForProvider(
logger.warn("backup provider not found anymore");
return;
}
- const opId = TaskIdentifiers.forBackup(prov);
- await scheduleRetryInTx(ws, tx, opId);
prov.shouldRetryFreshProposal = true;
prov.state = {
tag: BackupProviderStateTag.Retrying,
@@ -407,7 +395,7 @@ async function runBackupCycleForProvider(
return;
}
const opId = TaskIdentifiers.forBackup(prov);
- await scheduleRetryInTx(ws, tx, opId);
+ //await scheduleRetryInTx(ws, tx, opId);
prov.currentPaymentProposalId = result.proposalId;
prov.shouldRetryFreshProposal = false;
prov.state = {
@@ -481,7 +469,7 @@ async function runBackupCycleForProvider(
// FIXME: Allocate error code for this situation?
// FIXME: Add operation retry record!
const opId = TaskIdentifiers.forBackup(prov);
- await scheduleRetryInTx(ws, tx, opId);
+ //await scheduleRetryInTx(ws, tx, opId);
prov.state = {
tag: BackupProviderStateTag.Retrying,
};