Skip to content

Fix reject backup restore#120

Merged
cedelavergne-ledger merged 4 commits into
developfrom
cev/fix_reject_backup_restore
Jun 19, 2026
Merged

Fix reject backup restore#120
cedelavergne-ledger merged 4 commits into
developfrom
cev/fix_reject_backup_restore

Conversation

@cedelavergne-ledger

Copy link
Copy Markdown
Contributor

Description

  • Reply 0x6985 when user refuses Backup/Restore
  • Add ragger tests for refusing Backup/Restore
  • WUI: show an info notice when Backup/Restore is refused
  • Update CHANGELOG

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Tests
  • Documentation
  • Other (for changes that might not fit in any category)

The Backup/Restore approval used nbgl_useCaseConfirm, whose callback only
fires on "Approve". Pressing "Refuse" silently dismissed the modal without
sending any APDU response, so the host waited forever (the WebUI stayed stuck
with greyed-out buttons).

Switch to nbgl_useCaseChoice, which reports both outcomes: approve keeps the
previous behaviour, refuse answers SWO_CONDITIONS_NOT_SATISFIED (0x6985) and
returns to the home page.
Cover the refusal path: triggering a Backup/Restore and pressing "Refuse" on
the device must answer 0x6985 (ActionCancelledError). Adds an APDU_REJECT
navigation instruction for both the touch and Nano navigators, refusal helpers
on the command client, and two xfail tests.

Regenerate the Nano backup/restore approval snapshots: the screen now uses
nbgl_useCaseChoice and shows a small alert glyph.
A device refusal now returns 0x6985, which surfaced as a generic "failed"
error banner. Tag the mapped error with its status word and treat the
cancellation status apart: show an informational notice instead of an error.
@github-actions

Copy link
Copy Markdown
Contributor

Code coverage report

Code Coverage

Per-file coverage
Package Line Rate Branch Rate Health
src 67% 63%
Summary 67% (113 / 168) 63% (45 / 71)

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.88%. Comparing base (2baef71) to head (83b26fe).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #120   +/-   ##
========================================
  Coverage    81.88%   81.88%           
========================================
  Files            7        7           
  Lines          381      381           
  Branches        42       42           
========================================
  Hits           312      312           
  Misses          53       53           
  Partials        16       16           
Flag Coverage Δ
unittests 81.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cedelavergne-ledger
cedelavergne-ledger merged commit d40f5ff into develop Jun 19, 2026
71 checks passed
@cedelavergne-ledger
cedelavergne-ledger deleted the cev/fix_reject_backup_restore branch June 19, 2026 16:19
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