fix: polish trezor reliability and ux#1067
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis PR improves Trezor hardware-wallet reliability and transfer recovery. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Pairing sheets now use request IDs so repeated pairing prompts can replace the active route. |
| app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt | Hardware transfer flow now preserves signed transaction state for broadcast retry and avoids cancelling active broadcast bookkeeping. |
| app/src/main/java/to/bitkit/services/TrezorDebugLog.kt | Trezor diagnostics are sanitized before being stored in the in-app buffer and forwarded to the app logger. |
Reviews (5): Last reviewed commit: "fix: restore trezor funding signing" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3a8832be5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d132d02a3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Fixes #1030
This PR:
Description
This completes the app-level v1 reliability and UX polish for Trezor hardware wallets.
Pairing prompts now carry a request identity, so a wrong code followed by a new device code resets the input instead of leaving a spinner-only state. Device unlock remains on the Trezor itself.
Transfer to Spending now distinguishes reconnect, signing, and broadcast failures. Locked or busy devices show unlock guidance, network failures retain the signed transaction for an in-flow retry, and leaving the sign screen cancels the active operation so a later device approval cannot broadcast after the user exits.
The hardware wallet count is hidden when empty, connection failures include practical BLE guidance, and Trezor diagnostics are forwarded to the normal app log with pairing codes, PINs, passphrases, xpubs, PSBTs, and raw transactions redacted.
Passphrase/hidden-wallet pairing remains separately tracked in #1060. Emulator E2E coverage was handled in #1038. Durable signed-transaction recovery across process termination and deeper upstream transport retry changes are deliberate non-goals for this v1 polish.
Preview
QA Notes
Manual Tests
regression:Connect Hardware → turn Bluetooth off during connect → turn it back on: operation exits without an indefinite wait and reconnect can proceed.0value.Automated Checks
TrezorTransportTest.ktcovers unique pairing requests and releasing pending BLE operation latches.TrezorRepoTest.ktcovers locked-state handling, reconnect retries, and current-device reuse.HwConnectViewModelTest.ktandAppViewModelSendFlowTest.ktcover repeated pairing prompts and sheet routing.HwWalletRepoTest.ktcovers separate signing/broadcasting and hardware-wallet business behavior.TransferViewModelTest.ktcovers locked-device guidance, signed-broadcast retry, broadcast timeout, reconnect guidance, successful funding, and flow-exit cancellation.TrezorDebugLogTest.kt,TrezorExceptionExtTest.kt, andTrezorErrorPresenterTest.ktcover diagnostic redaction and user-facing error mapping.Made with Cursor