diff options
author | Florian Dold <florian@dold.me> | 2021-08-24 14:25:46 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-24 14:30:33 +0200 |
commit | 408d8e9fc896193fbcff1afd12aa04ab6d513798 (patch) | |
tree | a117a3c5d9130ea9b18c4198d3978f38dbd2f101 /packages/taler-wallet-core/src/db.ts | |
parent | 7553ae7c74bc04c268b77d010fb2f5b5eacad460 (diff) | |
download | wallet-core-408d8e9fc896193fbcff1afd12aa04ab6d513798.tar.xz |
towards handling frozen refreshes
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 093332e84..ef6b45c11 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -915,6 +915,17 @@ export interface TipRecord { retryInfo: RetryInfo; } +export enum RefreshCoinStatus { + Pending = "pending", + Finished = "finished", + + /** + * The refresh for this coin has been frozen, because of a permanent error. + * More info in lastErrorPerCoin. + */ + Frozen = "frozen", +} + export interface RefreshGroupRecord { /** * Retry info, even present when the operation isn't active to allow indexing @@ -926,8 +937,15 @@ export interface RefreshGroupRecord { lastErrorPerCoin: { [coinIndex: number]: TalerErrorDetails }; + /** + * Unique, randomly generated identifier for this group of + * refresh operations. + */ refreshGroupId: string; + /** + * Reason why this refresh group has been created. + */ reason: RefreshReason; oldCoinPubs: string[]; @@ -946,7 +964,7 @@ export interface RefreshGroupRecord { * it will be marked as finished, but no refresh session will * be created. */ - finishedPerCoin: boolean[]; + statusPerCoin: RefreshCoinStatus[]; timestampCreated: Timestamp; @@ -954,6 +972,11 @@ export interface RefreshGroupRecord { * Timestamp when the refresh session finished. */ timestampFinished: Timestamp | undefined; + + /** + * No coins are pending, but at least one is frozen. + */ + frozen?: boolean; } /** @@ -1162,6 +1185,9 @@ export interface PurchaseRecord { /** * Downloaded and parsed proposal data. + * + * FIXME: Move this into another object store, + * to improve read/write perf on purchases. */ download: ProposalDownload; |