Skip to content

fix(ledger): open the Stellar app when it is not running - #3038

Open
SmolinPavel wants to merge 3 commits into
stellar:masterfrom
SmolinPavel:fix/ledger-app-closed-error
Open

SmolinPavel wants to merge 3 commits into
stellar:masterfrom
SmolinPavel:fix/ledger-app-closed-error

Conversation

@SmolinPavel

Copy link
Copy Markdown
Contributor

What

When the Ledger is on its dashboard, Freighter now asks the device to open the Stellar app (the user confirms on the device) and reconnects. If another app is open (e.g. Ethereum), it quits that app first. Locked, declined and not-open cases show readable messages instead of raw status codes.

Why

Today a Ledger on its dashboard shows "Ledger device: UNKNOWN_ERROR (0x6511)", and with another app open it shows "Invalid data received (0x6a80)". Other wallets (e.g. MetaMask) open the app for the user.

Screenshots / video

Before After
Ledger device: UNKNOWN_ERROR (0x6511) Open-app prompt on the device, then connected

Checklist

  • I have read CONTRIBUTING.md and this PR meets its requirements.
  • This PR has narrow scope and does not mix refactoring with feature changes.
  • This PR adds tests for the new functionality or fixes.
  • These changes have been tested in both Chrome and Firefox. (Chromium only, on a Ledger Flex with Stellar app 6.1.0; Firefox has no WebHID.)
  • This PR includes relevant before and after screenshots for UI changes.
  • I took the time to review my own PR.

🤖 Generated with Claude Code

When the Ledger is on its dashboard, Freighter showed
"Ledger device: UNKNOWN_ERROR (0x6511)". Now it asks the device to open
the Stellar app (the user confirms on the device) and reconnects. If
another app is open, it quits that app first. Locked, declined and
not-open cases get readable messages instead of raw status codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SmolinPavel

Copy link
Copy Markdown
Contributor Author

@JakeUrban could you please review this one?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues remain in request timing, device targeting, dashboard detection, and decline handling.

3 open findings
What changed in this PR

Updates Ledger connection handling to open the Stellar app automatically and provide clearer error messages.

Changes:

  • Adds Ledger app switching and reconnection logic.
  • Adds English and Portuguese error translations.
  • Expands tests for Ledger connection scenarios.
File Summary
extension/​src/​popup/​locales/​pt/​translation.json Adds Portuguese Ledger error messages.
extension/​src/​popup/​locales/​en/​translation.json Adds English Ledger error messages.
extension/​src/​popup/​helpers/​hardwareConnect.ts Implements Ledger app detection, switching, reconnection, and error handling.
extension/​src/​popup/​helpers/​__tests__/​hardwareConnect.test.ts Tests new Ledger connection scenarios.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread extension/src/popup/helpers/hardwareConnect.ts Outdated
Comment thread extension/src/popup/helpers/hardwareConnect.ts
Comment thread extension/src/popup/helpers/hardwareConnect.ts Outdated
…boards

After switching apps the device comes back as a new HIDDevice, and
openConnected opens the first Ledger it finds. With two Ledgers attached
that could be the wrong one, so reconnect only when exactly one is
attached. Also treat "OLOS\0", which older firmware reports for the
dashboard, the same as "BOLOS".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SmolinPavel

Copy link
Copy Markdown
Contributor Author

@JakeUrban addressed Copilot's comments in 23497f2, CI is green. Ready for a look when you have time.

@JakeUrban
JakeUrban requested a review from piyalbasu October 19, 2026 18:13
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.

2 participants