[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet: logging, timestamp pa
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet: logging, timestamp parsing backwards compatibility |
Date: |
Wed, 30 Mar 2022 20:41:31 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 123b92b3 wallet: logging, timestamp parsing backwards compatibility
123b92b3 is described below
commit 123b92b3aa67f17d01586da0d7974de06318e551
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Mar 30 20:41:21 2022 +0200
wallet: logging, timestamp parsing backwards compatibility
---
packages/taler-util/src/time.ts | 9 +++++++++
packages/taler-wallet-core/src/operations/refresh.ts | 12 +++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts
index 344bc0f7..695d6d27 100644
--- a/packages/taler-util/src/time.ts
+++ b/packages/taler-util/src/time.ts
@@ -323,6 +323,15 @@ export function durationAdd(d1: Duration, d2: Duration):
Duration {
export const codecForTimestamp: Codec<TalerProtocolTimestamp> = {
decode(x: any, c?: Context): TalerProtocolTimestamp {
+ // Compatibility, should be removed soon.
+ const t_ms = x.t_ms;
+ if (typeof t_ms === "string") {
+ if (t_ms === "never") {
+ return { t_s: "never" };
+ }
+ } else if (typeof t_ms === "number") {
+ return { t_s: Math.floor(t_ms / 1000) };
+ }
const t_s = x.t_s;
if (typeof t_s === "string") {
if (t_s === "never") {
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts
b/packages/taler-wallet-core/src/operations/refresh.ts
index cf292061..1a473193 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -818,9 +818,15 @@ async function processRefreshGroupImpl(
logger.trace("processing refresh sessions for old coins");
const ps = refreshGroup.oldCoinPubs.map((x, i) =>
processRefreshSession(ws, refreshGroupId, i).catch((x) => {
- logger.warn("process refresh session got exception");
- logger.warn(`exc ${x}`);
- logger.warn(`exc stack ${x.stack}`);
+ if (x instanceof CryptoApiStoppedError) {
+ logger.info(
+ "crypto API stopped while processing refresh group, probably the
wallet is during shutdown",
+ );
+ } else {
+ logger.warn("process refresh session got exception");
+ logger.warn(`exc ${x}`);
+ logger.warn(`exc stack ${x.stack}`);
+ }
}),
);
try {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet: logging, timestamp parsing backwards compatibility,
gnunet <=