Skip to content

Commit

Permalink
fix(connect): do not release device when device is going to be discon…
Browse files Browse the repository at this point in the history
…nected
  • Loading branch information
mroz22 committed Feb 5, 2025
1 parent 711a083 commit a7f0b3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/connect/src/core/onCallFirmwareUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,11 @@ export const onCallFirmwareUpdate = async ({
{ payload: !intermediary && shouldStripFwHeaders(device.features) ? stripped : binary },
);

await reconnectedDevice.release();
log.info('onCallFirmwareUpdate', 'firmware uploaded');

if (intermediary) {
log.info('onCallFirmwareUpdate', '...but it was the intermediary firmware, so one more go');

reconnectedDevice = await waitForReconnectedDevice(
{ bootloader: true, method: 'manual', intermediary: true },
{ deviceList, device: reconnectedDevice, log, postMessage, abortSignal },
Expand All @@ -503,8 +505,6 @@ export const onCallFirmwareUpdate = async ({
reconnectedDevice,
{ payload: stripped },
);

await reconnectedDevice.release();
}

reconnectedDevice = await waitForReconnectedDevice(
Expand Down

0 comments on commit a7f0b3c

Please sign in to comment.