Skip to content

Commit

Permalink
chore(connect): fw-update: add error message when binary is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed May 22, 2024
1 parent 625abf5 commit c5fe863
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
31 changes: 21 additions & 10 deletions packages/connect/src/core/onCallFirmwareUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,28 @@ const getBinaryHelper = (
version: device.firmwareRelease.release.version,
btcOnly,
intermediaryVersion,
}).then(res => {
postMessage(
createUiMessage(UI.FIRMWARE_PROGRESS, {
device: device.toMessageObject(),
operation: 'downloading',
progress: 100,
}),
);
})
.then(res => {
console.log('res.byteLength', res.byteLength);

Check warning on line 207 in packages/connect/src/core/onCallFirmwareUpdate.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
// suspiciously small binary. this typically happens when build does not have git lfs enabled and all
// you download here are some pointers to lfs objects
if (res.byteLength < 1000) {
throw ERRORS.TypedError('Runtime', 'Firmware binary is too small');
}

return res;
});
return res;
})
.then(res => {
postMessage(
createUiMessage(UI.FIRMWARE_PROGRESS, {
device: device.toMessageObject(),
operation: 'downloading',
progress: 100,
}),
);

return res;
});
};

const firmwareCheck = async (
Expand Down
2 changes: 2 additions & 0 deletions packages/suite-web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ observer.observe(document.body, {
});

export {};

console.log('trigger build');

0 comments on commit c5fe863

Please sign in to comment.