Skip to content

Commit

Permalink
fixup! fix(connect): fix device hanged after initial getFeatures timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Jan 22, 2025
1 parent 7d1c922 commit 7757c67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/connect/src/device/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,10 @@ export class Device extends TypedEmitter<DeviceEvents> {
// set the timeout for this call so whenever it happens "unacquired device" will be created instead
// next time device should be called together with "Initialize" (calling "acquireDevice" from the UI)
new Promise((_resolve, reject) => {
getFeaturesTimeoutId = setTimeout(async () => {
await cancelPrompt(this, false);
reject(new Error('GetFeatures timeout'));
getFeaturesTimeoutId = setTimeout(() => {
cancelPrompt(this, false).finally(() => {
reject(new Error('GetFeatures timeout'));
});
}, getFeaturesTimeout);
}),
]);
Expand Down

0 comments on commit 7757c67

Please sign in to comment.