From 76a9e73fc1bd62f731c733513d79fcfcc42b6f2c Mon Sep 17 00:00:00 2001 From: jazalizil Date: Tue, 3 Dec 2024 14:39:52 +0100 Subject: [PATCH 1/2] :bug: (esbuild): Allow build with windows --- packages/tools/esbuild-tools/build.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/tools/esbuild-tools/build.mjs b/packages/tools/esbuild-tools/build.mjs index 0ef3676dd..ba68115be 100755 --- a/packages/tools/esbuild-tools/build.mjs +++ b/packages/tools/esbuild-tools/build.mjs @@ -1,10 +1,15 @@ #!/usr/bin/env zx import "zx/globals"; +import { usePowerShell } from "zx"; import esbuild from "esbuild"; import { nodeExternalsPlugin } from "esbuild-node-externals"; import { replaceTscAliasPaths } from "tsc-alias"; +if (process.platform === "win32") { + usePowerShell(); +} + const config = { minify: true, bundle: false, From 79e4e9b91cc53962f51c44a611d74923d08fafe6 Mon Sep 17 00:00:00 2001 From: jazalizil Date: Tue, 3 Dec 2024 14:40:56 +0100 Subject: [PATCH 2/2] :bug: (web-ble): Fix windows ble connect chrome --- .changeset/honest-eels-shave.md | 5 +++++ .../web-ble/src/api/transport/WebBleTransport.ts | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/honest-eels-shave.md diff --git a/.changeset/honest-eels-shave.md b/.changeset/honest-eels-shave.md new file mode 100644 index 000000000..5a87d490c --- /dev/null +++ b/.changeset/honest-eels-shave.md @@ -0,0 +1,5 @@ +--- +"@ledgerhq/device-transport-kit-web-ble": patch +--- + +Fix Chrome windows ble connect diff --git a/packages/transport/web-ble/src/api/transport/WebBleTransport.ts b/packages/transport/web-ble/src/api/transport/WebBleTransport.ts index e30d43d0e..ac5d3dbcd 100644 --- a/packages/transport/web-ble/src/api/transport/WebBleTransport.ts +++ b/packages/transport/web-ble/src/api/transport/WebBleTransport.ts @@ -255,7 +255,12 @@ export class WebBleTransport implements Transport { ); return discoveredDevice; } catch (error) { - await bleDevice.forget(); + this._logger.error("Error while discovering device", { + data: { error, bleDevice }, + }); + if (bleDevice.forget) { + await bleDevice.forget(); + } throw error; } }).caseOf({ @@ -350,8 +355,9 @@ export class WebBleTransport implements Transport { return Right(connectedDevice); } catch (error) { - await internalDevice.bleDevice.forget(); - + if (internalDevice.bleDevice.forget) { + await internalDevice.bleDevice.forget(); + } this._internalDevicesById.delete(deviceId); this._logger.error("Error while getting characteristics", {