feat: wire qr code errors#29741
Conversation
|
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. |
|
I've reviewed the code. Changes look decent and reasonable. I haven't tested, so just please find someone to do some additional manual testing if needed. |
|
@montelaidev this change seems to be working during onboarding and with dapp signing but for sending and swapping its really messed up. I think these issues might stem for this bug but either way I am seeing really weird results...
Here is a video: screen-20260512-190410-1778626845710.2.mp4 |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 49f5ad6. Configure here.
| return () => { | ||
| setQrScanRetryHandler?.(null); | ||
| }; | ||
| }, [setQrScanRetryHandler, showScanner]); |
There was a problem hiding this comment.
Signing retry doesn't reopen QR scanner
High Severity
The QR scan retry handlers registered in QRSigningDetails and QRInfo (which call showScanner()/setScannerVisible(true)) are never invoked during signing flows. When handleRetryQrScan in the provider runs and operationTypeRef.current is not null (signing is in progress), it transitions to AwaitingConfirmation and returns early without calling qrScanRetryHandlerRef.current(). The scanner stays closed, leaving the user stuck on the awaiting-confirmation bottom sheet with no way to re-scan. This contradicts the PR's stated goal that "signing confirmations can reopen the scanner from the error CTA."
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 49f5ad6. Configure here.
|
Will be fixed in this pr |





Description
Wires the QR scan errors from PR 2 into pairing and signing flows. QR scan failures now surface through the hardware wallet bottom sheet with retry support, signing confirmations can reopen the scanner from the error CTA, and replacement transaction gas params are normalized through the shared helper.
This is PR 3 of 3 and is stacked on #29388.
Changelog
CHANGELOG entry: Improved retry behavior when QR hardware wallet signing scans fail
Related issues
Refs: MUL-1665
Resolves: https://consensyssoftware.atlassian.net/browse/MUL-1513?atlOrigin=eyJpIjoiZThlODA2MTIwODU4NDA5ZmI1YjdlMjJkM2Q2ODdlOWQiLCJwIjoiaiJ9
Manual testing steps
Screenshots/Recordings
Before
After
Screen_Recording_20260512_222018_MetaMask.mp4
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
Touches QR hardware-wallet signing/pairing flows and error-handling/retry behavior, which can impact user ability to connect/sign if regressions occur. Changes are mostly additive/guarded and covered by expanded unit tests, but they alter control flow around modal visibility and error deduping.
Overview
Routes QR-hardware scan failures (non-UR, decode errors, wrong UR type, scan exceptions) out of
AnimatedQRScannerModalinto the Hardware Wallet bottom sheet via a newuseQrScanErrorForwardinghook, enabling Try again retry to reopen scanners in pairing (ConnectQRHardware), signing (QRSigningDetails), and confirmation QR signing (QRInfo).Hardens scanner behavior by deduplicating repeated error frames (
isSameScanError), avoiding repeated decoder resets/analytics, and resetting decoder/dedup state onvisibletransitions; also makes analytics sending resilient to failures.Improves QR transport handling by centralizing camera permission status constants (
CAMERA_PERMISSION_STATUS) and updatingQRWalletAdapterto request permission for any non-granted status; adds adapter factory support forHardwareWalletType.Qrand normalizes replacement-tx gas param typing via sharedReplacementTxParams.Reviewed by Cursor Bugbot for commit 49f5ad6. Bugbot is set up for automated code reviews on this repo. Configure here.