aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-09-30 13:11:17 +0200
committerFlorian Dold <florian@dold.me>2022-09-30 13:11:17 +0200
commit0a3f9979b201f4fc0c17bfeef370048f37f25611 (patch)
tree3d509ccab9927bb85c5c1104e810e81c5e7412d3
parent538f27e9dd5f55004e1fd1849ec7939afbec5c88 (diff)
firefox hotfixv0.9.0-dev.27
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/cryptoDispatcher.ts3
-rw-r--r--packages/taler-wallet-webextension/manifest-common.json4
-rw-r--r--packages/taler-wallet-webextension/src/browserWorkerEntry.ts26
-rw-r--r--packages/taler-wallet-webextension/src/wxBackend.ts2
4 files changed, 24 insertions, 11 deletions
diff --git a/packages/taler-wallet-core/src/crypto/workers/cryptoDispatcher.ts b/packages/taler-wallet-core/src/crypto/workers/cryptoDispatcher.ts
index 48c9c6060..8568f0db8 100644
--- a/packages/taler-wallet-core/src/crypto/workers/cryptoDispatcher.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/cryptoDispatcher.ts
@@ -22,7 +22,7 @@
/**
* Imports.
*/
-import { Logger, TalerErrorCode } from "@gnu-taler/taler-util";
+import { j2s, Logger, TalerErrorCode } from "@gnu-taler/taler-util";
import { TalerError } from "../../errors.js";
import { openPromise } from "../../util/promiseUtils.js";
import { timer, performanceNow, TimerHandle } from "../../util/timer.js";
@@ -265,6 +265,7 @@ export class CryptoDispatcher {
}),
);
} else {
+ logger.warn(`bad message: ${j2s(msg)}`);
currentWorkItem.reject(new Error("bad message from crypto worker"));
}
}
diff --git a/packages/taler-wallet-webextension/manifest-common.json b/packages/taler-wallet-webextension/manifest-common.json
index 36c4b74a9..f82ab5096 100644
--- a/packages/taler-wallet-webextension/manifest-common.json
+++ b/packages/taler-wallet-webextension/manifest-common.json
@@ -2,8 +2,8 @@
"name": "GNU Taler Wallet (git)",
"description": "Privacy preserving and transparent payments",
"author": "GNU Taler Developers",
- "version": "0.9.0.25",
- "version_name": "0.9.0-dev.25",
+ "version": "0.9.0.27",
+ "version_name": "0.9.0-dev.27",
"icons": {
"16": "static/img/taler-logo-16.png",
"19": "static/img/taler-logo-19.png",
diff --git a/packages/taler-wallet-webextension/src/browserWorkerEntry.ts b/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
index 1b6cfc455..2f1a26e36 100644
--- a/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
+++ b/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
@@ -22,8 +22,11 @@
* Imports.
*/
-import { Logger } from "@gnu-taler/taler-util";
-import { nativeCrypto } from "@gnu-taler/taler-wallet-core";
+import { j2s, Logger } from "@gnu-taler/taler-util";
+import {
+ getErrorDetailFromException,
+ nativeCrypto,
+} from "@gnu-taler/taler-wallet-core";
const logger = new Logger("browserWorkerEntry.ts");
@@ -41,13 +44,22 @@ async function handleRequest(
return;
}
+ logger.info(`browser worker crypto request: ${j2s(req)}`);
+
+ let responseMsg: any;
try {
- const result = await (impl as any)[operation](req);
- worker.postMessage({ result, id });
- } catch (e) {
- logger.error("error during operation", e);
- return;
+ const result = await (impl as any)[operation](impl, req);
+ responseMsg = { type: "success", result, id };
+ } catch (e: any) {
+ logger.error(`error during operation: ${e.stack ?? e.toString()}`);
+ responseMsg = {
+ type: "error",
+ id,
+ error: getErrorDetailFromException(e),
+ };
}
+
+ worker.postMessage(responseMsg);
}
worker.onmessage = (msg: MessageEvent) => {
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts
index 1dc6343c5..9581abc56 100644
--- a/packages/taler-wallet-webextension/src/wxBackend.ts
+++ b/packages/taler-wallet-webextension/src/wxBackend.ts
@@ -217,7 +217,7 @@ async function reinitWallet(): Promise<void> {
timer = new SetTimeoutTimerAPI();
} else {
httpLib = new BrowserHttpLib();
- cryptoWorker = new BrowserCryptoWorkerFactory();
+ cryptoWorker = new SynchronousCryptoWorkerFactory();
timer = new SetTimeoutTimerAPI();
}