Fix/ledger session usb#803
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
ff7a6e1 to
85eeac7
Compare
Harden Ledger USB session/connection handling so multi-Ledger or replug scenarios can't route calls to the wrong device: - Reject multiple USB devices instead of auto-selecting by ephemeral path (new DeviceOneDeviceOnly error; added to ORPHAN_ELIGIBLE_ERROR_CODES so a batch aborts on it). - ensureConnected does the ambient first-session fallback only when the caller passed no connectId; an explicit miss re-resolves THAT device. - Make device-state subscription setup fatal: on failure, disconnect the just-created DMK session so no ghost entry leaks into _sessions. - Evict any pre-existing session before opening a new USB connection. Scope: Ledger-only (hwk-ledger-adapter / hwk-adapter-core). Does not touch the OneKey SDK stack.
Addresses review feedback on multi-USB handling: - searchDevices() no longer rejects when multiple USB devices are present; it returns the full list so an explicit connectId can resolve its target. - _connectFirstOrSelect rejects multiple devices only on the no-target auto-connect path; an explicit connectId connects that device (or the sole USB device after an ephemeral-path replug) and otherwise fails not-found.
85eeac7 to
345d9fc
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
No description provided.