diff --git a/patches/@ledgerhq+hw-transport-webhid+6.29.4.patch b/patches/@ledgerhq+hw-transport-webhid+6.29.4.patch new file mode 100644 index 00000000000..6ce77042bff --- /dev/null +++ b/patches/@ledgerhq+hw-transport-webhid+6.29.4.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js b/node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js +index 8246e08..b79c4c0 100644 +--- a/node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js ++++ b/node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js +@@ -107,8 +107,19 @@ class TransportWebHID extends Transport { + let result; + let acc; + while (!(result = framing.getReducedResult(acc))) { +- const buffer = yield this.read(); +- acc = framing.reduceResponse(acc, buffer); ++ try { ++ const buffer = yield this.read(); ++ acc = framing.reduceResponse(acc, buffer); ++ } catch (e) { ++ if (e instanceof TransportError && e.id === "InvalidChannel") { ++ // this can happen if the device is connected ++ // on a different channel (like another app) ++ // in this case we just filter out the event ++ console.log(e); ++ continue; ++ } ++ throw e; ++ } + } + log("apdu", "<= " + result.toString("hex")); + return result;