firefox hotfix

This commit is contained in:
Florian Dold 2022-09-30 13:11:17 +02:00
parent 538f27e9dd
commit 0a3f9979b2
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
4 changed files with 24 additions and 11 deletions

View File

@ -22,7 +22,7 @@
/** /**
* Imports. * Imports.
*/ */
import { Logger, TalerErrorCode } from "@gnu-taler/taler-util"; import { j2s, Logger, TalerErrorCode } from "@gnu-taler/taler-util";
import { TalerError } from "../../errors.js"; import { TalerError } from "../../errors.js";
import { openPromise } from "../../util/promiseUtils.js"; import { openPromise } from "../../util/promiseUtils.js";
import { timer, performanceNow, TimerHandle } from "../../util/timer.js"; import { timer, performanceNow, TimerHandle } from "../../util/timer.js";
@ -265,6 +265,7 @@ export class CryptoDispatcher {
}), }),
); );
} else { } else {
logger.warn(`bad message: ${j2s(msg)}`);
currentWorkItem.reject(new Error("bad message from crypto worker")); currentWorkItem.reject(new Error("bad message from crypto worker"));
} }
} }

View File

@ -2,8 +2,8 @@
"name": "GNU Taler Wallet (git)", "name": "GNU Taler Wallet (git)",
"description": "Privacy preserving and transparent payments", "description": "Privacy preserving and transparent payments",
"author": "GNU Taler Developers", "author": "GNU Taler Developers",
"version": "0.9.0.25", "version": "0.9.0.27",
"version_name": "0.9.0-dev.25", "version_name": "0.9.0-dev.27",
"icons": { "icons": {
"16": "static/img/taler-logo-16.png", "16": "static/img/taler-logo-16.png",
"19": "static/img/taler-logo-19.png", "19": "static/img/taler-logo-19.png",

View File

@ -22,8 +22,11 @@
* Imports. * Imports.
*/ */
import { Logger } from "@gnu-taler/taler-util"; import { j2s, Logger } from "@gnu-taler/taler-util";
import { nativeCrypto } from "@gnu-taler/taler-wallet-core"; import {
getErrorDetailFromException,
nativeCrypto,
} from "@gnu-taler/taler-wallet-core";
const logger = new Logger("browserWorkerEntry.ts"); const logger = new Logger("browserWorkerEntry.ts");
@ -41,13 +44,22 @@ async function handleRequest(
return; return;
} }
logger.info(`browser worker crypto request: ${j2s(req)}`);
let responseMsg: any;
try { try {
const result = await (impl as any)[operation](req); const result = await (impl as any)[operation](impl, req);
worker.postMessage({ result, id }); responseMsg = { type: "success", result, id };
} catch (e) { } catch (e: any) {
logger.error("error during operation", e); logger.error(`error during operation: ${e.stack ?? e.toString()}`);
return; responseMsg = {
type: "error",
id,
error: getErrorDetailFromException(e),
};
} }
worker.postMessage(responseMsg);
} }
worker.onmessage = (msg: MessageEvent) => { worker.onmessage = (msg: MessageEvent) => {

View File

@ -217,7 +217,7 @@ async function reinitWallet(): Promise<void> {
timer = new SetTimeoutTimerAPI(); timer = new SetTimeoutTimerAPI();
} else { } else {
httpLib = new BrowserHttpLib(); httpLib = new BrowserHttpLib();
cryptoWorker = new BrowserCryptoWorkerFactory(); cryptoWorker = new SynchronousCryptoWorkerFactory();
timer = new SetTimeoutTimerAPI(); timer = new SetTimeoutTimerAPI();
} }