Skip to content

fix: [lw-12138] handle disconnected ledger wallet error #1574

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

Merged

Conversation

vetalcore
Copy link
Contributor

Context

There are multiple Failed to execute 'releaseInterface' on 'USBDevice' issues reported by sentry.
Further investigation confirmed that hw-transport-webusb package also attaches a disconnect event listener while creating a Ledger transport, so we might end up trying to handle disconnection multiple times.

Proposed Solution

Wrap transport.close call in the on disconnect handler with a try catch clause.

Important Changes Introduced

@vetalcore vetalcore self-assigned this Jan 29, 2025
mirceahasegan
mirceahasegan previously approved these changes Jan 29, 2025

try {
await transport.close();
} catch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the error be inspected to ensure it's the expected failure before ignoring?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@vetalcore vetalcore force-pushed the fix/lw-12138-handle-disconnected-ledger-wallet-error branch from 49550e3 to 638b866 Compare January 30, 2025 12:44
@vetalcore vetalcore merged commit 7fbec27 into master Jan 30, 2025
5 of 6 checks passed
@vetalcore vetalcore deleted the fix/lw-12138-handle-disconnected-ledger-wallet-error branch January 30, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants