Skip to content

Detect error APDUs during navigation to have proper error APDUs exceptions instead of timeouts#265

Merged
fbeutin-ledger merged 1 commit intomasterfrom
fbe/raise_during_navigation
Jan 30, 2026
Merged

Detect error APDUs during navigation to have proper error APDUs exceptions instead of timeouts#265
fbeutin-ledger merged 1 commit intomasterfrom
fbe/raise_during_navigation

Conversation

@fbeutin-ledger
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.81%. Comparing base (9c99cb5) to head (2e2661d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
+ Coverage   77.69%   77.81%   +0.12%     
==========================================
  Files          36       36              
  Lines        2170     2182      +12     
==========================================
+ Hits         1686     1698      +12     
  Misses        484      484              
Flag Coverage Δ
apex_p-py3.10 77.72% <100.00%> (+0.12%) ⬆️
apex_p-py3.11 77.72% <100.00%> (+0.12%) ⬆️
apex_p-py3.12 77.72% <100.00%> (+0.12%) ⬆️
apex_p-py3.13 77.72% <100.00%> (+0.12%) ⬆️
apex_p-py3.9 77.70% <100.00%> (+0.12%) ⬆️
flex-py3.10 77.72% <100.00%> (+0.12%) ⬆️
flex-py3.11 77.72% <100.00%> (+0.12%) ⬆️
flex-py3.12 77.72% <100.00%> (+0.12%) ⬆️
flex-py3.13 77.72% <100.00%> (+0.12%) ⬆️
flex-py3.9 77.70% <100.00%> (+0.12%) ⬆️
nanos-py3.10 76.07% <100.00%> (+0.13%) ⬆️
nanos-py3.11 76.07% <100.00%> (+0.13%) ⬆️
nanos-py3.12 76.07% <100.00%> (+0.13%) ⬆️
nanos-py3.13 76.07% <100.00%> (+0.13%) ⬆️
nanos-py3.9 76.18% <100.00%> (+0.13%) ⬆️
nanosp-py3.10 76.12% <100.00%> (+0.13%) ⬆️
nanosp-py3.11 76.12% <100.00%> (+0.13%) ⬆️
nanosp-py3.12 76.12% <100.00%> (+0.13%) ⬆️
nanosp-py3.13 76.12% <100.00%> (+0.13%) ⬆️
nanosp-py3.9 76.22% <100.00%> (+0.13%) ⬆️
nanox-py3.10 76.07% <100.00%> (+0.13%) ⬆️
nanox-py3.11 76.07% <100.00%> (+0.13%) ⬆️
nanox-py3.12 76.07% <100.00%> (+0.13%) ⬆️
nanox-py3.13 76.07% <100.00%> (+0.13%) ⬆️
nanox-py3.9 76.18% <100.00%> (+0.13%) ⬆️
stax-py3.10 77.72% <100.00%> (+0.12%) ⬆️
stax-py3.11 77.72% <100.00%> (+0.12%) ⬆️
stax-py3.12 77.72% <100.00%> (+0.12%) ⬆️
stax-py3.13 77.72% <100.00%> (+0.12%) ⬆️
stax-py3.9 77.70% <100.00%> (+0.12%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances error handling in the Speculos backend by detecting APDU errors during navigation operations, preventing test timeouts when applications return error responses. Instead of waiting indefinitely for screen changes that will never occur, the code now checks for async APDU errors proactively and raises exceptions immediately.

Changes:

  • Added _check_async_error() method to detect and raise APDU errors early during async operations
  • Modified wait_for_screen_change() to check for async errors in each iteration before sending ticks
  • Updated exchange_async_raw() to track pending async responses for error detection
  • Added comprehensive test coverage for the new error detection behavior

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/ragger/backend/speculos.py Implements async error detection mechanism with new _pending_async_response attribute, _check_async_error() method, and integration into navigation loops
tests/functional/backend/test_speculos.py Adds test verifying that errors are raised during navigation rather than at context exit
CHANGELOG.md Documents the feature addition in version 1.42.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fbeutin-ledger fbeutin-ledger force-pushed the fbe/raise_during_navigation branch from cb060cc to 2e2661d Compare January 29, 2026 15:34
@sonarqubecloud
Copy link

@fbeutin-ledger fbeutin-ledger merged commit 16d6f9e into master Jan 30, 2026
58 checks passed
@fbeutin-ledger fbeutin-ledger deleted the fbe/raise_during_navigation branch January 30, 2026 17:36
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.

5 participants