feat(hw): add QR scan error handling#29388
Conversation
Made-with: Cursor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 77c9162. Configure here.
Co-authored-by: Monte Lai <montelaidev@users.noreply.github.com>
ccharly
left a comment
There was a problem hiding this comment.
LGTM! I left 2 comments about "error anylitics/metrics" cause I'm not sure I understood quite well this part. Though, some tests were already named that way, so that might be ok but if you can double-check that's better 😄
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokeAccounts is selected because its description explicitly covers 'adding QR-based hardware wallet accounts', which is the primary user flow affected by the AnimatedQRScanner changes. The QR scanner is used during the hardware wallet pairing flow (ConnectQRHardware) and signing flow (QRSigningDetails), both of which are part of the hardware wallet account management experience. No other tags are directly impacted - the changes are isolated to hardware wallet QR scanning infrastructure and don't touch confirmations, network management, browser, snaps, or other flows. Confidence is moderate (72) because no dedicated E2E tests for QR hardware wallet scanning were found in the test suite, so coverage validation is limited to the broader SmokeAccounts suite. Performance Test Selection: |
|




Description
Adds shared QR hardware scan error types and updates the animated QR scanner to classify non-UR payloads, decode failures, wrong UR types, and scan exceptions. This gives QR hardware flows user-facing retry/learn-more states and structured analytics instead of falling back to generic unknown QR errors.
This is PR 1 of 2. PR 2 stacks on this branch and wires the scanner errors into the connection/signing flows.
Changelog
CHANGELOG entry: Improved QR hardware wallet scan error messages and retry handling
Related issues
Refs: MUL-1665
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Made with Cursor
Note
Medium Risk
Updates QR hardware scanning flow to gate scanning on UR format and introduces new error types/UI states; bugs here could block pairing/signing scans or skew hardware wallet error analytics.
Overview
Adds structured QR hardware scan errors and inline recovery UI.
AnimatedQRScannernow classifies non-UR payloads, UR decode failures, wrong UR types, and scan exceptions intoQRHardwareScanErrorobjects, shows a dedicated error screen with Learn more and Try again, and prevents repeated error handling until reset (with optionalonQRHardwareScanErrorandonModalHideCompletecallbacks).Improves analytics and error plumbing. Hardware wallet error metrics now include
is_ur_formatpluserror_category/received_ur_typewhere relevant, adds new localized copy for QR scan errors and camera-permission-denied mapping (RecoveryAction.OPEN_SETTINGS), and introducesgetReplacementGasFeeParamsto normalize replacement transaction gas params (legacy vs EIP-1559) with tests.Reviewed by Cursor Bugbot for commit c49a680. Bugbot is set up for automated code reviews on this repo. Configure here.