Skip to content

fix: show the jade not set up message - #2144

Merged
ovitrif merged 3 commits into
masterfrom
fix/jade-review-followups
Nov 27, 2026
Merged

ovitrif merged 3 commits into
masterfrom
fix/jade-review-followups

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Refs:

Description

  • Fixes the Found Jade step showing the generic "Hardware device is not set up" for a Jade with no wallet, because the repository threw a vendor-neutral error the Jade presenter could not map; it now throws JadeException.DeviceUninitialized, so the step shows the Jade text, as iOS does
  • Fixes J1's FROM check, because the confirmation screen starts with its details collapsed; the journey taps Show details first
  • Fixes the psbt journey's setup, because Bitcoin Core refuses more than 25 chained unconfirmed sends; it mines every 20 sends and now parses as XML

These are the review points raised on #2052, moved here so its approval stood.

Out of Scope

  • None.

Design

N/A — no design available.

Preview

J5 at the head of this branch: the Found step for a Jade with no wallet.

QA Notes

Setup

  1. bitkit-docker at a6e9ed0 (feat: add a jade emulator bitkit-docker#45): docker compose up -d, then JADE_MNEMONIC= ./scripts/jade-emulator start for J5.
  2. A regtest debug build with JADE_EMULATOR=true in local.properties and no Jade paired.

Journeys

  • J1: updated jade-connect-sign.xml — taps Show details before checking FROM
  • J5: jade-uninitialized.xml (unchanged) — the Found step shows the Jade not set up text
  • J7: updated jade-psbt-too-large.xml — setup mines every 20 sends so 200 inputs fund the Jade
  • Trezor send: updated send-onchain.xml — taps Show details before checking FROM

Manual Tests

N/A

Automated Checks

  • updated JadeRepoTest.kt — connecting a Jade with no wallet fails with JadeException.DeviceUninitialized

Evidence

  • J5 passed on an Android emulator at d07d6c9 against the Jade emulator with no wallet: Found shows "This Jade has not been set up yet. Create or restore a wallet on the device, then try again." (screenshot above).
  • just compile, just test and just lint passed at d07d6c9.

Gaps

  • J1, J7 and the Trezor send journey were not rerun here; only their setup and step text changed.

Models used

  • Planning/scoping: Claude Opus 5.5 (reasoning: medium)
  • Implementation: Claude Opus 5.5 (reasoning: medium)
  • Review: Claude Sonnet 5.5 (reasoning: high)
  • Review rounds: 1

Connecting a Jade with no wallet now throws JadeException.DeviceUninitialized, so the Found step shows the Jade text, as iOS does, instead of the generic hardware message. J1 opens Show details before it checks FROM, and the psbt journey mines a block every 20 sends and parses as XML.

Verified: just compile, JadeRepoTest and HwErrorPresenterTest, just test, just lint
@ovitrif ovitrif self-assigned this Nov 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T20:59:39.544406Z d07d6c9 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Verified: none (file rename only)
@ovitrif
ovitrif requested review from a team, ben-kaufman and piotr-iohk and removed request for a team November 26, 2026 20:58
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Fixes the setup message shown when a Jade has no wallet.

  • An uninitialized Jade shows its setup message when someone tries to connect.
  • The send journey opens details before checking the Jade source.
  • The oversized-PSBT setup mines funds every 20 sends.

Reviews (1) · Last reviewed commit: "fix: show the jade not set up message" · Reviewed by Greptile

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Makes JadeRepo reject a Jade with no wallet with JadeException.DeviceUninitialized, which HwErrorPresenter already maps to hardware__jade_uninitialized, removes the now unused HwDeviceUninitializedError, and updates J1 and J7 setup text. Reviewed 2ea193f, light tier.

What I checked, and 3 candidates I ruled out

Read in full: JadeRepo.kt (connect path, rejectUnusableDevice, connectExpectedDevice, cleanupFailedConnection), HwErrorPresenter.kt, JadeExceptionExt.kt
Call sites traced: HwDeviceUninitializedError has no remaining reference at the head; JadeException.DeviceUninitialized is matched only in HwErrorPresenter (and its test)
Build: not built here. On the Bitkit track a review does not run the branch's Gradle build; this is reasoned from the code and from CI.
CI: build-and-test, build-local, ui-tests and lint still running when this was posted.

Ruled out

  • Retry loop on the new type: connectExpectedDevice keeps trying the next candidate only for JadeIdentityMismatchError and HwWalletMismatchError; the new exception is rethrown just as the old one was, and the finally cleanup is unchanged.
  • Reclassified as a session failure: isJadeSessionFailure and isJadeDeviceBusy list specific subtypes and neither includes DeviceUninitialized, so the reconnect and busy handling treat it as before.
  • Journey drift: SendConfirmToggleDetails and SendConfirmAssetButton both exist in SendConfirmScreen.kt; both edited journey files still parse as XML.

Merge confidence: 4/5, CI had not finished and the branch was not built here; JadeRepoTest.kt covers the changed throw.

Reviewer model: Claude Opus 5.5
Reasoning effort: Not exposed (the review session does not report an effort setting)

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 9e442d2 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: full PR diff against its merge base, at 2ea193f.

No new actionable code findings.

No actionable code findings. When JadeRepo connects to a Jade that reports UNINIT, it now rejects it with JadeException.DeviceUninitialized. HwErrorPresenter already maps that to hardware__jade_uninitialized, so the Found step (through HwConnectViewModel.onConnectFailed) and the repository error state (JadeRepo.errorMessage) both resolve to the Jade-specific text. This covers pairing, known-device reconnect and auto-reconnect. Error handling is otherwise unchanged:

  • connectExpectedDevice still rethrows anything except identity or wallet mismatches.
  • cleanupFailedConnection still runs in finally.
  • The new type is not in isJadeSessionFailure or isJadeDeviceBusy.

The removed HwDeviceUninitializedError has no remaining references, and at the base it was only thrown by JadeRepo. The no-argument DeviceUninitialized() constructor already compiled at the base in HwErrorPresenterTest, and the head's CI build-and-test passed (run).

iOS parity: bitkit-ios at d30d2d6ecd323650b0d076bf08df1d0918cee99b throws JadeError.DeviceUninitialized for .uninit in JadeManager.swift and maps it to the same string key, so Android now matches. This was checked from source only, with no visual comparison.

Journeys:

  • J1: the new SendConfirmToggleDetails step is correct. For an on-chain send, details start collapsed (initialShowDetails defaults to false), and SendConfirmAssetButton is only shown inside OnChainDetails once they are expanded.
  • J7: the base file failed to parse as XML because of the literal <jade address>. The head file parses. The new loop mines 10 blocks over 200 sends, keeps unconfirmed chains at 20 or fewer, and confirms the last batch.
  • jade-uninitialized.xml (J5): the PR description calls it updated, but this PR does not change it. It already expected the Jade text at the base.

Validation: I parsed the journey XML and checked the loop arithmetic locally. I did not run a Gradle build or tests here. The CI e2e and compose UI jobs were still pending when I checked.

Device testing: not performed in this review. The author reports that J5 passed on an emulator at d07d6c9. J1 and J7 were not rerun, according to the author's own notes on gaps.

Ready for device testing on the requested journeys J1, J5 and J7, using the author's bitkit-docker and Jade emulator setup.

Reviewer model: claude-opus-5-5
Reasoning effort: high

@ovitrif

ovitrif commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

@piotr-iohk Corrected the description: this PR leaves jade-uninitialized.xml (J5) as it was and only changes what the app shows, and the setup now points at bitkit-docker a6e9ed0.

@ovitrif
ovitrif requested review from jvsena42 and pwltr and removed request for ben-kaufman November 27, 2026 11:25
@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Ben is away for a few days, so I moved this review request to @pwltr and @jvsena42.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code scan at 2ea193f: no findings.

Checked and clean:

  • rejectUnusableDevice now throws JadeException.DeviceUninitialized for UNINIT. The throw is still in connectDevice before unlockConnected/exportAccounts, and the NonCancellable cleanup still disconnects, so no session stays connected (JadeRepoTest asserts it).
  • The new type is classified like the old one everywhere: not a session failure (no reconnect-and-sign-again in HwSendViewModel.sign, no retry in verifyJadeReceiveAddress/signJadeFunding), not busy, not a user cancellation, not a firmware error. connectExpectedDevice still rethrows it.
  • In a send it can only arise in ensureConnected, before anything reaches the device. handleFailure takes the plain error branch with no pending broadcast.
  • Every Jade connect error display goes through HwErrorPresenter (HwConnectViewModel.onConnectFailed, JadeRepo.errorMessage, HwSendViewModel.handleFailure, HwReceiveViewModel.handleVerifyFailure), which already maps the type to hardware__jade_uninitialized. No hardware path renders the raw message. A locked device still maps to the busy text.
  • HwDeviceUninitializedError has no remaining references.
  • Journeys: J1's new SendConfirmToggleDetails step matches the app, since on-chain details start collapsed and SendConfirmAssetButton lives inside them. J7 now parses as XML and its funding loop keeps unconfirmed chains under 25. J5 already expects this text.
  • No string resources changed.

perf: not relevant.

Device gate (partial): 2ea193f — not run yet; J5, J1 and J7 need the Jade emulator. Result to follow.

Reviewer model: Opus 5.5 (claude-opus-5-5) coordinating; Fable 5.2 (claude-fable-5-2) primary review
Reasoning effort: Not exposed

@jvsena42

Copy link
Copy Markdown
Member

Outside this PR's scope; no change needed here.

Trezor send journey has the same stale review-screen step J1 had. journeys/hardware-wallet/send-onchain.xml:39 (master) asks to verify SendConfirmAssetButton on the Send review screen right after Continue. On an on-chain send the details start collapsed (initialShowDetails is false), and SendConfirmAssetButton only renders inside OnChainDetails after SendConfirmToggleDetails is tapped (SendConfirmScreen.kt:577, :692). An agent driving the journey as written fails that step. journeys/hardware-wallet/README.md:119 also lists the send tags without SendConfirmToggleDetails. Related: #2065 (same step in the custom-fee journey). Suggested follow-up in bitkit-android: add the toggle step to send-onchain.xml and the tag to the suite README.

On-chain send details start collapsed, so the FROM field only appears after Show details; the Trezor send journey now taps it, as J1 does, and the suite README lists the tag.

Verified: xmllint on the journey
@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

@jvsena42 Added here in 9e442d2, since it is the same one-step journey fix as J1: send-onchain.xml now taps Show details (SendConfirmToggleDetails) before checking SendConfirmAssetButton, and the suite README lists the tag. #2065 (the custom fee journey in the send suite) stays as its own issue.

@pwltr pwltr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 9e442d2. No issues found. A Jade with no wallet is now rejected with JadeException.DeviceUninitialized, which HwErrorPresenter already maps to the Jade set-up text, so the Found step shows it instead of the generic connect error. The Trezor send journey now opens Show details before checking the FROM field, as the Jade journey does.

Review details

General review: Claude Opus 5.5, high reasoning effort

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

QA review

Scope: changes since 2ea193f, including affected code paths and prior findings, at 9e442d2. Baseline: prior QA review.

No new actionable code findings.

The follow-up only updates journeys/hardware-wallet/send-onchain.xml and journeys/hardware-wallet/README.md; all six surfaces from the baseline remain unchanged and inherited. For a normal Trezor on-chain send, SendConfirmScreen.kt defaults initialShowDetails to false (lines 226 and 429) and only renders SendConfirmAssetButton inside OnChainDetails (lines 500–507, 683–693) once SendConfirmToggleDetails (line 577) is tapped—the collapsed funding-source button (lines 473–481) is gated on isPaymentRequest. Adding the SendConfirmToggleDetails tap before checking SendConfirmAssetButton in send-onchain.xml and listing SendConfirmToggleDetails in journeys/hardware-wallet/README.md matches the app and jade-connect-sign.xml, and no other hardware-wallet journey asserts SendConfirmAssetButton without expanding details.

Reconciliation: The earlier J5 description note was corrected by the author, and this follow-up addresses the stale Trezor review-screen step raised in review comment. No open review threads or unresolved findings remain.

iOS parity: synonymdev/bitkit-ios at af19cc1 (journeys/hardware-wallet/send-onchain.xml) already uses the same SendConfirmToggleDetails identifier on the review screen (source comparison only; no visual comparison performed).

Validation: Verified XML well-formedness (xmllint --noout) on send-onchain.xml, jade-connect-sign.xml, and jade-psbt-too-large.xml and ran git diff --check locally; no local Gradle build or tests were run because this delta touches only journey specs and docs. On 9e442d2, CI build-and-test, compose-ui / ui-tests, build, lint, and detekt passed (build run, lint run); e2e-tests-local shards were still running when checked (e2e run).

Device testing: not performed in this review. The author reports J5 passed on an Android emulator at d07d6c9 and notes J1, J7, and Trezor send-onchain.xml were not rerun (only journey setup and step text changed).

Ready for device testing on the requested journeys: J1, J5, and J7 using the Jade emulator setup, and Trezor send-onchain.xml using the Bridge emulator setup in journeys/hardware-wallet/README.md.

Reviewer model: gemini-4-neon
Reasoning effort: high

@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: approved at 9e442d2 with checks green and no open threads; the J5 run at d07d6c9 covers the app code, as later commits change only journey text and the changelog fragment name.

@ovitrif
ovitrif merged commit e94bfa5 into master Nov 27, 2026
23 checks passed
@ovitrif
ovitrif deleted the fix/jade-review-followups branch November 27, 2026 12:19
@ovitrif ovitrif added this to the 3.2.0 milestone Nov 27, 2026
@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Placed in 3.2.0: this PR merged to master before the 3.2.0 cut, so it ships in 3.2.0.

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