taler-typescript-core

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

commit a733e533900718c6cc1a9860037ad2c99cc970e1
parent 335c996d4dc00d1f7f98bd8f39e883db0c8fb9d5
Author: Florian Dold <dold@taler.net>
Date:   Tue, 18 Aug 2026 19:04:22 +0200

wallet-core: remove stored backups

Diffstat:
Dpackages/taler-harness/src/integrationtests/test-stored-backups.ts | 123-------------------------------------------------------------------------------
Mpackages/taler-harness/src/integrationtests/test-wallet-refresh-errors.ts | 11+++++------
Mpackages/taler-harness/src/integrationtests/testrunner.ts | 2--
Mpackages/taler-util/src/types-taler-wallet.ts | 30------------------------------
Mpackages/taler-wallet-cli/src/index.ts | 50--------------------------------------------------
Mpackages/taler-wallet-core/src/db-indexeddb.ts | 56--------------------------------------------------------
Mpackages/taler-wallet-core/src/dbtx-handle-impl.ts | 9+++------
Mpackages/taler-wallet-core/src/dbtx-sqlite.ts | 13++++---------
Mpackages/taler-wallet-core/src/requests.ts | 150+++----------------------------------------------------------------------------
Mpackages/taler-wallet-core/src/wallet-api-types.ts | 52----------------------------------------------------
Mpackages/taler-wallet-core/src/wallet.ts | 7+++----
11 files changed, 19 insertions(+), 484 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-stored-backups.ts b/packages/taler-harness/src/integrationtests/test-stored-backups.ts @@ -1,123 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2023 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -/** - * Imports. - */ -import { TalerMerchantApi } from "@gnu-taler/taler-util"; -import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { - makeTestPaymentV2, - createSimpleTestkudosEnvironmentV3, - withdrawViaBankV3, -} from "../harness/environments.js"; -import { GlobalTestState } from "../harness/harness.js"; - -/** - * Test stored backup wallet-core API. - */ -export async function runStoredBackupsTest(t: GlobalTestState) { - // Set up test environment - - const { - walletClient, - exchange, - merchant, - merchantAdminAccessToken, - bankClient, - } = await createSimpleTestkudosEnvironmentV3(t); - - // Withdraw digital cash into the wallet. - - const wres = await withdrawViaBankV3(t, { - walletClient, - bankClient, - exchange, - amount: "TESTKUDOS:20", - }); - - await wres; - - await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - - const sb1Resp = await walletClient.call( - WalletApiOperation.CreateStoredBackup, - {}, - ); - const sbList = await walletClient.call( - WalletApiOperation.ListStoredBackups, - {}, - ); - t.assertTrue(sbList.storedBackups.length === 1); - t.assertTrue(sbList.storedBackups[0].name === sb1Resp.name); - - const order = { - summary: "Buy me!", - amount: "TESTKUDOS:5", - fulfillment_url: "taler://fulfillment-success/thx", - } satisfies TalerMerchantApi.Order; - - await makeTestPaymentV2(t, { - walletClient, - merchant, - order, - merchantAdminAccessToken, - }); - await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - - const txn1 = await walletClient.call(WalletApiOperation.GetTransactions, {}); - t.assertDeepEqual(txn1.transactions.length, 2); - - // Recover from the stored backup now. - - const sb2Resp = await walletClient.call( - WalletApiOperation.CreateStoredBackup, - {}, - ); - - console.log("recovering backup"); - - await walletClient.call(WalletApiOperation.RecoverStoredBackup, { - name: sb1Resp.name, - }); - - console.log("first recovery done"); - - // Recovery went well, now we can delete the backup - // of the old database we stored before importing. - { - const sbl1 = await walletClient.call( - WalletApiOperation.ListStoredBackups, - {}, - ); - t.assertTrue(sbl1.storedBackups.length === 2); - - await walletClient.call(WalletApiOperation.DeleteStoredBackup, { - name: sb1Resp.name, - }); - const sbl2 = await walletClient.call( - WalletApiOperation.ListStoredBackups, - {}, - ); - t.assertTrue(sbl2.storedBackups.length === 1); - } - - const txn2 = await walletClient.call(WalletApiOperation.GetTransactions, {}); - // We only have the withdrawal after restoring - t.assertDeepEqual(txn2.transactions.length, 1); -} - -runStoredBackupsTest.suites = ["wallet", "shared-env"]; diff --git a/packages/taler-harness/src/integrationtests/test-wallet-refresh-errors.ts b/packages/taler-harness/src/integrationtests/test-wallet-refresh-errors.ts @@ -70,10 +70,7 @@ export async function runWalletRefreshErrorsTest(t: GlobalTestState) { }); await wres.withdrawalFinishedCond; - const backupResp = await walletClient.call( - WalletApiOperation.CreateStoredBackup, - {}, - ); + const backupDump = await walletClient.call(WalletApiOperation.ExportDb, {}); const coinDump = await walletClient.call(WalletApiOperation.DumpCoins, {}); @@ -90,8 +87,10 @@ export async function runWalletRefreshErrorsTest(t: GlobalTestState) { await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - await walletClient.call(WalletApiOperation.RecoverStoredBackup, { - name: backupResp.name, + // ImportDb replaces existing records rather than merging them, so this + // restores the wallet to its exact pre-refresh state. + await walletClient.call(WalletApiOperation.ImportDb, { + dump: backupDump, }); await walletClient.call(WalletApiOperation.ForceRefresh, { diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts @@ -175,7 +175,6 @@ import { runRepurchaseV1Test } from "./test-repurchase-v1.js"; import { runRepurchaseTest } from "./test-repurchase.js"; import { runRevocationTest } from "./test-revocation.js"; import { runSimplePaymentTest } from "./test-simple-payment.js"; -import { runStoredBackupsTest } from "./test-stored-backups.js"; import { runTimetravelAutorefreshTest } from "./test-timetravel-autorefresh.js"; import { runTimetravelWithdrawTest } from "./test-timetravel-withdraw.js"; import { runTopsAmlBasicTest } from "./test-tops-aml-basic.js"; @@ -353,7 +352,6 @@ const allTests: TestMainFunction[] = [ runWithdrawalConversionTest, runWithdrawalHugeTest, runTermOfServiceFormatTest, - runStoredBackupsTest, runPaymentExpiredTest, runWalletGenDbTest, runLibeufinBankTest, diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts @@ -3898,36 +3898,6 @@ export interface TransactionRecordFilter { onlyCurrency?: string; } -export interface StoredBackupList { - storedBackups: { - name: string; - }[]; -} - -export interface CreateStoredBackupResponse { - name: string; -} - -export interface RecoverStoredBackupRequest { - name: string; -} - -export interface DeleteStoredBackupRequest { - name: string; -} - -export const codecForDeleteStoredBackupRequest = - (): Codec<DeleteStoredBackupRequest> => - buildCodecForObject<DeleteStoredBackupRequest>() - .property("name", codecForString()) - .build("DeleteStoredBackupRequest"); - -export const codecForRecoverStoredBackupRequest = - (): Codec<RecoverStoredBackupRequest> => - buildCodecForObject<RecoverStoredBackupRequest>() - .property("name", codecForString()) - .build("RecoverStoredBackupRequest"); - export interface TestingSetTimetravelRequest { offsetMs: number; } diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts @@ -2987,56 +2987,6 @@ backupCli.subcommand("exportDb", "export-db").action(async (args) => { }); }); -backupCli.subcommand("storeBackup", "store").action(async (args) => { - await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { - const resp = await wallet.client.call( - WalletApiOperation.CreateStoredBackup, - {}, - ); - console.log(JSON.stringify(resp, undefined, 2)); - }); -}); - -backupCli.subcommand("storeBackup", "list-stored").action(async (args) => { - await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { - const resp = await wallet.client.call( - WalletApiOperation.ListStoredBackups, - {}, - ); - console.log(JSON.stringify(resp, undefined, 2)); - }); -}); - -backupCli - .subcommand("storeBackup", "delete-stored") - .requiredArgument("name", clk.STRING) - .action(async (args) => { - await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { - const resp = await wallet.client.call( - WalletApiOperation.DeleteStoredBackup, - { - name: args.storeBackup.name, - }, - ); - console.log(JSON.stringify(resp, undefined, 2)); - }); - }); - -backupCli - .subcommand("recoverBackup", "recover-stored") - .requiredArgument("name", clk.STRING) - .action(async (args) => { - await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { - const resp = await wallet.client.call( - WalletApiOperation.RecoverStoredBackup, - { - name: args.recoverBackup.name, - }, - ); - console.log(JSON.stringify(resp, undefined, 2)); - }); - }); - backupCli.subcommand("importDb", "import-db").action(async (args) => { await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { const dumpRaw = await read(process.stdin); diff --git a/packages/taler-wallet-core/src/db-indexeddb.ts b/packages/taler-wallet-core/src/db-indexeddb.ts @@ -245,15 +245,6 @@ export const TALER_WALLET_MAIN_DB_NAME = "taler-wallet-main-v10"; export const TALER_WALLET_META_DB_NAME = "taler-wallet-meta"; /** - * Name of the "stored backups" database. - * Stored backups are created before manually importing a backup. - * We use IndexedDB for this purpose, since we don't have file system - * access on some platforms. - */ -export const TALER_WALLET_STORED_BACKUPS_DB_NAME = - "taler-wallet-stored-backups"; - -/** * Name of the "meta config" database. */ export const CURRENT_DB_CONFIG_KEY = "currentMainDbName"; @@ -1362,19 +1353,6 @@ export const walletMetadataStore = { ), }; -export interface StoredBackupMeta { - name: string; -} - -export const StoredBackupStores = { - backupMeta: describeStore( - "backupMeta", - describeContents<StoredBackupMeta>({ keyPath: "name" }), - {}, - ), - backupData: describeStore("backupData", describeContents<any>({}), {}), -}; - export interface DbDumpRecord { /** * Key, serialized with structuredEncapsulated. @@ -2414,40 +2392,6 @@ function onMetaDbUpgradeNeeded( ); } -function onStoredBackupsDbUpgradeNeeded( - db: IDBDatabase, - oldVersion: number, - newVersion: number, - upgradeTransaction: IDBTransaction, -) { - upgradeFromStoreMap( - StoredBackupStores, - db, - oldVersion, - newVersion, - upgradeTransaction, - ); -} - -export async function openStoredBackupsDatabase( - idbFactory: IDBFactory, -): Promise<DbAccess<typeof StoredBackupStores>> { - const backupsDbHandle = await openDatabase( - idbFactory, - TALER_WALLET_STORED_BACKUPS_DB_NAME, - 1, - () => {}, - onStoredBackupsDbUpgradeNeeded, - ); - - const handle = new DbAccessImpl( - backupsDbHandle, - StoredBackupStores, - CancellationToken.CONTINUE, - ); - return handle; -} - /** * Return a promise that resolves * to the taler wallet db. diff --git a/packages/taler-wallet-core/src/dbtx-handle-impl.ts b/packages/taler-wallet-core/src/dbtx-handle-impl.ts @@ -134,8 +134,8 @@ export class IdbWalletDbHandle implements WalletDbHandle { } /** - * The raw DbAccess, for the two things that are IndexedDB concerns rather - * than database concerns: the fixup log, and the stored-backup database. + * The raw DbAccess for the fixup log, which is an IndexedDB concern rather + * than a generic database concern. * * Reachable only through this class, so generic code cannot pick it up by * accident the way it could when the wallet state exposed a factory. @@ -148,10 +148,7 @@ export class IdbWalletDbHandle implements WalletDbHandle { return this.dbAccess; } - /** - * The IndexedDB factory, for the stored-backup database, which is a - * separate database that has nothing to do with wallet records. - */ + /** The IndexedDB factory used by hosts that install the bridge shim. */ factory(): BridgeIDBFactory { return this.idbFactory; } diff --git a/packages/taler-wallet-core/src/dbtx-sqlite.ts b/packages/taler-wallet-core/src/dbtx-sqlite.ts @@ -5413,9 +5413,8 @@ async function listDataTables(ndb: NativeSqliteWalletDb): Promise<string[]> { /** * A dump of every row in the native wallet database. * - * Deliberately a plain row dump rather than a file copy: it is stored inside - * another database as JSON, the same way the IndexedDB export is, so the - * stored-backup API works the same for both backends. + * Deliberately a plain row dump rather than a file copy so that it can be + * represented as JSON, like an IndexedDB export. */ export interface NativeSqliteDbDump { schemaVersion: number; @@ -5425,12 +5424,8 @@ export interface NativeSqliteDbDump { /** * A BLOB column in a dump. * - * Tagged rather than raw bytes because the dump is stored in the IndexedDB - * backup database, and that layer cannot persist binary at all: - * structuredEncapsulate, which serialises values on their way to storage, - * handles arrays, dates, plain objects, bigint, boolean, number and string, - * and throws on anything else -- typed arrays included. (Its in-memory clone - * does support them, so this only bites on persistence.) + * Tagged rather than raw bytes because the dump must be JSON-compatible; + * typed arrays otherwise lose their type when serialized. */ export interface DumpBlob { $blob: string; diff --git a/packages/taler-wallet-core/src/requests.ts b/packages/taler-wallet-core/src/requests.ts @@ -51,10 +51,8 @@ import { ConvertIbanAccountFieldToPaytoResponse, ConvertIbanPaytoToAccountFieldRequest, ConvertIbanPaytoToAccountFieldResponse, - CreateStoredBackupResponse, DeleteDiscountRequest, DeleteExchangeRequest, - DeleteStoredBackupRequest, DeleteSubscriptionRequest, EmptyObject, ExportDbToFileRequest, @@ -107,7 +105,6 @@ import { PerformanceTable, PrepareWithdrawExchangeRequest, PrepareWithdrawExchangeResponse, - RecoverStoredBackupRequest, RemoveGlobalCurrencyAuditorRequest, RemoveGlobalCurrencyExchangeRequest, Result, @@ -116,7 +113,6 @@ import { SharePaymentRequest, SharePaymentResult, StartRefundQueryRequest, - StoredBackupList, SuspendTransactionRequest, TalerBankIntegrationHttpClient, TalerError, @@ -180,7 +176,6 @@ import { codecForDeleteDiscountRequest, codecForDeleteExchangeRequest, codecForDeleteMailboxMessageRequest, - codecForDeleteStoredBackupRequest, codecForDeleteSubscriptionRequest, codecForDeleteTransactionRequest, codecForEmptyObject, @@ -233,7 +228,6 @@ import { codecForPreparePeerPushCreditRequest, codecForPrepareRefundRequest, codecForPrepareWithdrawExchangeRequest, - codecForRecoverStoredBackupRequest, codecForRemoveGlobalCurrencyAuditorRequest, codecForRemoveGlobalCurrencyExchangeRequest, codecForResumeTransaction, @@ -289,11 +283,7 @@ import { timestampAbsoluteFromDb, timestampProtocolToDb, } from "./db-common.js"; -import { - CoinSourceType, - openStoredBackupsDatabase, - walletDbFixups, -} from "./db-indexeddb.js"; +import { CoinSourceType, walletDbFixups } from "./db-indexeddb.js"; import { IdbWalletDbHandle } from "./dbtx-handle-impl.js"; import { isCandidateWithdrawableDenomRec, @@ -623,11 +613,9 @@ async function dumpCoins(wex: WalletExecutionContext): Promise<CoinDumpJson> { /** * The IndexedDB backend, or an error naming what needs it. * - * Stored backups and the fixup log are IndexedDB concerns: the native schema - * starts clean and evolves through schemaMigrations, so it has no fixup log, - * and stored backups were never implemented for it. Failing loudly here beats - * the alternative these call sites used to have, where reaching for the - * emulation under the native backend silently operated on an empty database. + * The fixup log is an IndexedDB concern: the native schema starts clean and + * evolves through schemaMigrations, so it has no fixup log. Failing loudly + * here beats silently operating on an unrelated emulation database. */ function requireIdbBackend( wex: WalletExecutionContext, @@ -644,97 +632,6 @@ function requireIdbBackend( return idb; } -async function createStoredBackup( - wex: WalletExecutionContext, -): Promise<CreateStoredBackupResponse> { - // The dump comes from the wallet database, whichever backend that is. The - // backups themselves live in a separate IndexedDB database, which is only - // available on the IndexedDB backend. - const backup = await wex.ws.db.exportDatabase(); - const idb = requireIdbBackend(wex, "stored backups"); - const backupsDb = await openStoredBackupsDatabase(idb.factory()); - const name = `backup-${new Date().getTime()}`; - await backupsDb.runAllStoresReadWriteTx({}, async (tx) => { - await tx.backupMeta.add({ - name, - }); - await tx.backupData.add(backup, name); - }); - return { - name, - }; -} - -async function listStoredBackups( - wex: WalletExecutionContext, -): Promise<StoredBackupList> { - const storedBackups: StoredBackupList = { - storedBackups: [], - }; - const backupsDb = await openStoredBackupsDatabase( - requireIdbBackend(wex, "stored backups").factory(), - ); - await backupsDb.runAllStoresReadWriteTx({}, async (tx) => { - await tx.backupMeta.iter().forEach((x) => { - storedBackups.storedBackups.push({ - name: x.name, - }); - }); - }); - return storedBackups; -} - -async function deleteStoredBackup( - wex: WalletExecutionContext, - req: DeleteStoredBackupRequest, -): Promise<void> { - const backupsDb = await openStoredBackupsDatabase( - requireIdbBackend(wex, "stored backups").factory(), - ); - await backupsDb.runAllStoresReadWriteTx({}, async (tx) => { - await tx.backupData.delete(req.name); - await tx.backupMeta.delete(req.name); - }); -} - -async function recoverStoredBackup( - wex: WalletExecutionContext, - req: RecoverStoredBackupRequest, -): Promise<void> { - logger.info(`Recovering stored backup ${req.name}`); - const { name } = req; - const backupsDb = await openStoredBackupsDatabase( - requireIdbBackend(wex, "stored backups").factory(), - ); - const bd = await backupsDb.runAllStoresReadWriteTx({}, async (tx) => { - const backupMeta = await tx.backupMeta.get(name); - if (!backupMeta) { - throw TalerError.fromDetail( - TalerErrorCode.WALLET_CORE_API_BAD_REQUEST, - { parameter: "name" }, - `stored backup ${name} not found`, - ); - } - const backupData = await tx.backupData.get(name); - if (!backupData) { - throw Error("no backup data (DB corrupt)"); - } - return backupData; - }); - logger.info(`backup found, now importing`); - // importDatabase leaves the records repaired, so the transaction view is - // rebuilt from repaired records rather than from whatever the dump held. - await wex.ws.db.importDatabase(bd); - await wex.runWalletDbTx(async (tx) => { - await rematerializeTransactions(wex, tx); - }); - - // Both branches replaced the database wholesale, bypassing the DAL that - // normally notices such changes, so the caches have to be dropped by hand. - wex.ws.clearAllCaches(); - logger.info(`import done`); -} - async function handlePrepareWithdrawExchange( wex: WalletExecutionContext, req: PrepareWithdrawExchangeRequest, @@ -790,22 +687,6 @@ async function handleSharePayment( return await sharePayment(wex, req.merchantBaseUrl, req.orderId); } -async function handleDeleteStoredBackup( - wex: WalletExecutionContext, - req: DeleteStoredBackupRequest, -): Promise<EmptyObject> { - await deleteStoredBackup(wex, req); - return {}; -} - -async function handleRecoverStoredBackup( - wex: WalletExecutionContext, - req: RecoverStoredBackupRequest, -): Promise<EmptyObject> { - await recoverStoredBackup(wex, req); - return {}; -} - /** * Highest number of HTTP redirects followed while probing one candidate base * URL, so that a redirect loop cannot keep the completion running forever. @@ -1920,13 +1801,6 @@ async function handleDeleteExchange( return {}; } -async function handleCreateStoredBackup( - wex: WalletExecutionContext, - _req: EmptyObject, -): Promise<CreateStoredBackupResponse> { - return await createStoredBackup(wex); -} - async function handleExportDbToFile( wex: WalletExecutionContext, req: ExportDbToFileRequest, @@ -2516,18 +2390,6 @@ const handlers: { [T in WalletApiOperation]: HandlerWithValidator<T> } = { codec: codecForAbortTransaction(), handler: handleAbortTransaction, }, - [WalletApiOperation.CreateStoredBackup]: { - codec: codecForEmptyObject(), - handler: handleCreateStoredBackup, - }, - [WalletApiOperation.DeleteStoredBackup]: { - codec: codecForDeleteStoredBackupRequest(), - handler: handleDeleteStoredBackup, - }, - [WalletApiOperation.ListStoredBackups]: { - codec: codecForEmptyObject(), - handler: listStoredBackups, - }, [WalletApiOperation.CompleteExchangeBaseUrl]: { codec: codecForCompleteBaseUrlRequest(), handler: handleCompleteExchangeBaseUrl, @@ -2541,10 +2403,6 @@ const handlers: { [T in WalletApiOperation]: HandlerWithValidator<T> } = { codec: codecForInitRequest(), handler: handleSetWalletRunConfig, }, - [WalletApiOperation.RecoverStoredBackup]: { - codec: codecForRecoverStoredBackupRequest(), - handler: handleRecoverStoredBackup, - }, [WalletApiOperation.WithdrawTestkudos]: { codec: codecForEmptyObject(), handler: handleWithdrawTestkudos, diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -72,12 +72,10 @@ import { ConvertIbanPaytoToAccountFieldResponse, CreateDepositGroupRequest, CreateDepositGroupResponse, - CreateStoredBackupResponse, DeleteContactRequest, DeleteDiscountRequest, DeleteExchangeRequest, DeleteMailboxMessageRequest, - DeleteStoredBackupRequest, DeleteSubscriptionRequest, DeleteTransactionRequest, EmptyObject, @@ -172,7 +170,6 @@ import { PrepareRefundRequest, PrepareWithdrawExchangeRequest, PrepareWithdrawExchangeResponse, - RecoverStoredBackupRequest, RemoveGlobalCurrencyAuditorRequest, RemoveGlobalCurrencyExchangeRequest, Result, @@ -187,7 +184,6 @@ import { StartExchangeWalletKycRequest, StartRefundQueryForUriResponse, StartRefundQueryRequest, - StoredBackupList, TaldirLookupRequest, TaldirLookupResponse, TaldirRegistrationCompletionRequest, @@ -368,13 +364,6 @@ export enum WalletApiOperation { CompleteRegisterAlias = "completeRegisterAlias", LookupAlias = "lookupAlias", - // Stored backups - - ListStoredBackups = "listStoredBackups", - CreateStoredBackup = "createStoredBackup", - DeleteStoredBackup = "deleteStoredBackup", - RecoverStoredBackup = "recoverStoredBackup", - // Wallet database management ImportDb = "importDb", @@ -1290,30 +1279,6 @@ export type ImportDbFromFileOp = { response: EmptyObject; }; -export type ListStoredBackupsOp = { - op: WalletApiOperation.ListStoredBackups; - request: EmptyObject; - response: StoredBackupList; -}; - -export type CreateStoredBackupsOp = { - op: WalletApiOperation.CreateStoredBackup; - request: EmptyObject; - response: CreateStoredBackupResponse; -}; - -export type RecoverStoredBackupsOp = { - op: WalletApiOperation.RecoverStoredBackup; - request: RecoverStoredBackupRequest; - response: EmptyObject; -}; - -export type DeleteStoredBackupOp = { - op: WalletApiOperation.DeleteStoredBackup; - request: DeleteStoredBackupRequest; - response: EmptyObject; -}; - // group: Peer Payments /** @@ -2027,19 +1992,6 @@ export const walletApiExpectedErrors = { TalerErrorCode.WALLET_DB_BACKEND_UNSUPPORTED, TalerErrorCode.WALLET_CORE_API_BAD_REQUEST, ], - [WalletApiOperation.CreateStoredBackup]: [ - TalerErrorCode.WALLET_DB_BACKEND_UNSUPPORTED, - ], - [WalletApiOperation.ListStoredBackups]: [ - TalerErrorCode.WALLET_DB_BACKEND_UNSUPPORTED, - ], - [WalletApiOperation.DeleteStoredBackup]: [ - TalerErrorCode.WALLET_DB_BACKEND_UNSUPPORTED, - ], - [WalletApiOperation.RecoverStoredBackup]: [ - TalerErrorCode.WALLET_DB_BACKEND_UNSUPPORTED, - TalerErrorCode.WALLET_CORE_API_BAD_REQUEST, - ], } as const; export type WalletOperations = { @@ -2128,10 +2080,6 @@ export type WalletOperations = { [WalletApiOperation.TestingWaitExchangeReady]: TestingWaitExchangeReadyOp; [WalletApiOperation.TestingWaitTasksDone]: TestingWaitTasksDoneOp; [WalletApiOperation.GetCurrencySpecification]: GetCurrencySpecificationOp; - [WalletApiOperation.CreateStoredBackup]: CreateStoredBackupsOp; - [WalletApiOperation.ListStoredBackups]: ListStoredBackupsOp; - [WalletApiOperation.DeleteStoredBackup]: DeleteStoredBackupOp; - [WalletApiOperation.RecoverStoredBackup]: RecoverStoredBackupsOp; [WalletApiOperation.UpdateExchangeEntry]: UpdateExchangeEntryOp; [WalletApiOperation.PrepareWithdrawExchange]: PrepareWithdrawExchangeOp; [WalletApiOperation.DeleteExchange]: DeleteExchangeOp; diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -923,10 +923,9 @@ export class InternalWalletState { } /** - * The IndexedDB-specific handle, for the two concerns that genuinely belong - * to that backend: the fixup log and the stored-backup database. Undefined - * when the native backend is in use, so a caller has to say what it does - * when the capability is absent. + * The IndexedDB-specific handle for the fixup log. Undefined when the + * native backend is in use, so a caller has to say what it does when the + * capability is absent. */ public get idbOnly(): IdbWalletDbHandle | undefined { const h = this.dbHandle;