Skip to content

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

Merged
JakeUrban merged 7 commits into
stellar:masterfrom
SmolinPavel:fix/ledger-app-closed-error
Nov 2, 2026
Merged

JakeUrban merged 7 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.

…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
…ed-error

# Conflicts:
#	extension/src/popup/locales/en/translation.json
#	extension/src/popup/locales/pt/translation.json
@SmolinPavel

Copy link
Copy Markdown
Contributor Author

@JakeUrban @piyalbasu - can we merge this one?

piyalbasu and others added 2 commits October 30, 2026 15:09
--z-index--ledger tied with --z-index-modal at 30, so stacking between the
HardwareSign overlay and a modal depended on DOM order. 31 puts the Ledger
overlay above modals; its inner layer (var + 1) becomes 32.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@piyalbasu

Copy link
Copy Markdown
Contributor

@JakeUrban @piyalbasu - can we merge this one?

Hey @SmolinPavel Sorry for the delay here! We had some other work that needed to get merged. Just reviewed this with my Ledger and this is looking good to me! I noticed there was a CSS issue with the Ledger modal while testing, so I pushed one commit to your PR to fix that.

@JakeUrban
JakeUrban merged commit e972930 into stellar:master Nov 2, 2026
11 checks passed
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.

4 participants