Detect error APDUs during navigation to have proper error APDUs exceptions instead of timeouts#265
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
…tions instead of timeouts
cb060cc to
2e2661d
Compare
|



No description provided.