Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connect): skip fw hash check when binary too tiny (DX) #15201

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/connect/src/device/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,14 @@ export class Device extends TypedEmitter<DeviceEvents> {

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

return createFailResult('check-unsupported');
}

Expand Down
Loading