Skip to content

Commit f330e63

Browse files
committed
fix(connect): skip fw hash check when binary too tiny (DX)
1 parent 603ef07 commit f330e63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/connect/src/device/Device.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,14 @@ export class Device extends TypedEmitter<DeviceEvents> {
773773

774774
const btcOnly = this.firmwareType === FirmwareType.BitcoinOnly;
775775
const binary = await getBinaryOptional({ baseUrl, btcOnly, release });
776+
// release was found, but not its binary - happens on desktop, where only local files are searched
776777
if (binary === null) {
777-
// release was found, but not its binary - happens on desktop, where only local files are searched
778+
return createFailResult('check-unsupported');
779+
}
780+
// binary was found, but it's likely a git LFS pointer (can happen on dev) - see onCallFirmwareUpdate.ts
781+
if (binary.byteLength < 200) {
782+
_log.warn(`Firmware binary for hash check suspiciously small (< 200 b)`);
783+
778784
return createFailResult('check-unsupported');
779785
}
780786

0 commit comments

Comments
 (0)