diff options
author | Florian Dold <florian@dold.me> | 2022-03-08 23:09:20 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-08 23:09:20 +0100 |
commit | 6ee0354940c09d1065c3b3b7bf08e41fd6014268 (patch) | |
tree | 7d127977b1517702082d0253099f25c3fa26289f /packages/taler-wallet-core/src/operations/README.md | |
parent | d5a933e4cb685aab3e5e6bae5ca2358291e59130 (diff) | |
download | wallet-core-6ee0354940c09d1065c3b3b7bf08e41fd6014268.tar.xz |
wallet: improve retry handling for payments, update error codes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/README.md')
-rw-r--r-- | packages/taler-wallet-core/src/operations/README.md | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/README.md b/packages/taler-wallet-core/src/operations/README.md index ca7140d6a..426f2c553 100644 --- a/packages/taler-wallet-core/src/operations/README.md +++ b/packages/taler-wallet-core/src/operations/README.md @@ -2,6 +2,25 @@ This folder contains the implementations for all wallet operations that operate on the wallet state. -To avoid cyclic dependencies, these files must **not** reference each other. Instead, other operations should only be accessed via injected dependencies. +To avoid cyclic dependencies, these files must **not** reference each other. Instead, other operations should only be accessed via injected dependencies. Avoiding cyclic dependencies is important for module bundlers. + +## Retries + +Many operations in the wallet are automatically retried when they fail or when the wallet +is still waiting for some external condition (such as a wire transfer to the exchange). + +Retries are generally controlled by a "retryInfo" field in the corresponding database record. This field is set to undefined when no retry should be scheduled. + +Generally, the code to process a pending operation should first increment the +retryInfo (and reset the lastError) and then process the operation. This way, +it is impossble to forget incrementing the retryInfo. + +For each retriable operation, there are usually `reset<Op>Retry`, `increment<Op>Retry` and +`report<Op>Error` operations. + +Note that this means that _during_ some operation, lastError will be cleared. The UI +should accommodate for this. + +It would be possible to store a list of last errors, but we currently don't do that. |