Repository navigation
Conversation
Verified: just test (7034 tests; ElectrumProbeServiceTest unreachable-host case failed under load and passes alone, untouched by this change), just lint, PubkyAuthApprovalViewModelTest and WatchOnlyAccountRepoTest after the last edit
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51f95a17c4
ℹ️ 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".
Confidence Score: 2/5
[Medium impact] The change affects Paykit server approval for wallets with active Bitcoin accounts. Fix retry consistency and durable tracking before merging. Findings
SummaryAdds a Bitcoin account choice to server approval, with same-name preselection and an option to create a new account.
Acknowledged scope: Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Receiving-details consent] --> B{Unfinished setup?}
B -->|Yes| C[Resume the same account]
B -->|No active accounts| D[Prepare a new account]
B -->|Active accounts exist| E[Choose an account]
E -->|Existing| F[Prepare reused account]
E -->|New| D
C --> G[Deliver claim and authorize]
D --> G
F --> G
G -->|Success| H[Activate or enable tracking]
G -->|Failure| I[Return to authorization]
Reviews (1) · Last reviewed commit: "fix: offer existing server accounts on r..." · Reviewed by Greptile |
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
talosmachina
left a comment
There was a problem hiding this comment.
1 finding (1 P1). Adds a Bitcoin Account step to Paykit server re-approval, so an existing active account can be shared again instead of reserving a new index. Reviewed 51f95a1, full tier, static.
What I checked, and 4 candidates I ruled out
Read in full: WatchOnlyAccountRepo.kt, the changed paths of PubkyAuthApprovalViewModel.kt (load, approveWatchOnlyConsent, selectAccount, confirmAccountChoice, returnToPreviousStep, authorize, approveSignInRequest, handleApprovalFailure, preselectedAccountId), PubkyAuthApprovalSheet.kt (ChooseAccountContent, approvalBackAction), the new tests in PubkyAuthApprovalViewModelTest.kt and WatchOnlyAccountRepoTest.kt.
Call sites traced: prepareUnsignedClaim, beginAuthorization, cancelAuthorization, setTrackingEnabled, markActive, isPostDeliveryAuthorizationFailure.
Not built: on this repo I review from the code and CI and do not build the branch.
CI: Greptile, build-local and detect-changes green; build-and-test, lint, compose-ui and the local e2e jobs were still pending when I posted.
Ruled out
- Reused account cancelled on a failed retry:
cancelAuthorizationreturns early for anActiverecord, and the view model skipscancelIncompleteSetupwhenisReused, so a reused account's state is never rolled back. - Reuse on the signup path:
approveSignupAuthrequiresbitkitClaim == null, soreuseAccountIdnever reaches a signup. - Stale selection after a new auth URL:
resetForLoadrebuilds the state from scratch, soexistingAccountsandselectedAccountIddo not carry over to another request. - Tracking a reused account that the user turned off:
setTrackingEnabled(enabled = true)runs only after delivery (success or post-delivery failure), and that matches the PR's stated intent.
A second reader from another model family tried to refute the finding; it stood.
Merge confidence: 3/5, one P1 on a retry path.
Reviewer model: claude-opus-5-5, cold refutation pass xiaomi/mimo-v2.6-pro
Reasoning effort: Not exposed (the runtime does not report it for either model)
Verified: just test, just lint
|
@aldertnl copy for the new Bitcoin Account step on Paykit server re-approval, for your review (screens under Preview; the same on iOS in synonymdev/bitkit-ios#1587):
The step shows only when the wallet already has server accounts. It preselects the account whose name matches this server's default name; with no match it preselects "New account". Sharing one account with several servers lets those servers link the user's payments to one wallet, which the description only hints at. The strings stay English until the copy settles: #2250 and synonymdev/bitkit-ios#1585. |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: full PR diff against its merge base, at 3b9ed537.
No new actionable code findings.
No new actionable code findings. When the wallet already has active server accounts, Paykit re-approval shows a Bitcoin Account step, preselects the same-name account (tracked accounts first, then newest), and shares that account's stored xpub without reserving a new index. A reused account stays unchanged if authorization fails before delivery, and tracking is turned on only after the claim is delivered. "New account" still creates one account. Back and Cancel before authorization do not write a setup.
The review on 51f95a1 that a failed "New account" attempt still offered the chooser, so a later selection was ignored, is marked resolved (Talos, Codex, Greptile). At this head a failed approval that leaves a non-active setup clears the chooser, including when the failure happens before delivery and the record remains PendingDelivery. Back returns to the Earn introduction, and a retry resumes that unfinished account. The same flow is in bitkit-ios#1587 at 850d67bf. That comparison covers this flow only.
Open threads ask for a tracking flag saved before delivery (Codex, Greptile). Tracking is applied after delivery so a failure before delivery leaves a reused account untracked. If enabling tracking then fails, the sheet shows the authorization error and a retry runs it again. Startup loads only accounts already marked tracked, and Server Accounts can turn tracking on. This review does not add that window as a defect. An open thread about a second xpub after a delivered reuse (Greptile) is a later explicit choice, which this head sends as selected.
The three new strings stay English until #2250. Other locales fall back to that English. That thread is marked resolved as out of scope. No design was available for the new step.
Non-blocking consistency suggestions
- TalkBack cannot tell which account is selected: the checkmark has no content description and the row has no selected state. iOS sets the selected trait on the same row.
- The iOS suite README notes that the default account name is "{service} account" there and "{service} server" here. The Android README for this journey does not. Preselection compares names on the same platform.
Device testing: not performed in this review. The author reports the choice screen on 51f95a1; J1 Back, Cancel, and Authorize were not run. build-and-test and lint succeeded on this commit. Some local end-to-end jobs were still running and are not evidence for this flow.
Suggested additional test cases
- Android, regtest, one active server account. Choose "New account" and fail authorization before the server accepts. Back should show the Earn introduction. Authorizing again should keep a single new account for that URL and should not share the original account.
- Android, several active accounts that share the default name, as in #2237. The checked row should be the newest tracked account and visible on the step. Continue and Authorize should keep that derivation path and xpub, with tracking on, and should not add an account.
Reviewer model: grok-4.7
Reasoning effort: xhigh
Verified: just test, just lint
Verified: git diff --check
@piotr-iohk both are in: the choice rows set the selected state in e3ffa9e, and the suite README notes the per-app default name in b5c7d56. One change since 3b9ed53 you reviewed: in e3ffa9e a reused account that was untracked is now tracked before its claim is sent and stays tracked whatever the outcome (the Codex and Greptile threads you mention), and after a post-delivery failure the open sheet pins a retry to the account the server already holds. Keeping that pin once the sheet is closed and reopened is #2253. |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: changes since 3b9ed537, including affected code paths and prior findings, at b5c7d567. Baseline: QA review.
No new actionable code findings.
No new actionable code findings in the follow-up. An untracked reused account is marked tracked before its claim is sent, and that tracking remains if authorization fails. While the sheet stays open, a post-delivery authorization failure pins the retry to that account and hides the account choice. The choice rows now publish a selected state, and the journey README notes that Android's default name is "{service} server" while iOS uses "{service} account". The same tracking and in-sheet pin are in bitkit-ios#1587 at c8fbfbc6; that comparison covers this flow only. Baseline coverage of watch-only claim reuse, unfinished-setup resume, the English account-choice strings, and the changelog fragment is unchanged.
A failed "New account" attempt still clears the chooser, so a later selection is not ignored. That thread is resolved (Talos). Closing the sheet and reopening the same URL can still share a different account after a delivered reuse; that thread is resolved and tracked in #2253. The three new strings stay English until #2250; that thread is resolved.
Device testing: not performed in this review. The author reports the choice screen on 51f95a1; J1 Back, Cancel, and Authorize were not run. build-and-test and lint succeeded on this commit. Local end-to-end jobs were still running and are not evidence for this flow. TalkBack was not run.
Suggested additional test cases
- Android, regtest, one active server account with tracking off. Open a fresh setup URL, keep that account, and disable the network before Authorize. After the error, Server Accounts should show that same account as tracked, and the open sheet should still offer the account choice.
Reviewer model: grok-4.7
Reasoning effort: xhigh
Verified: just test, just lint
The store can say tracked while the node lost the account, so the node is always asked to track a reused account before its claim is sent. Verified: just test, just lint
|
Pushed b8fcf71 and 5b2a9b5: a reused account is now tracked in one step under the account lock before its claim is sent. The approval fails if the account is no longer active on this wallet (a restore or wipe removed it meanwhile), and the node is asked to track it even when the store already says tracked, since the node can lose it. |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: changes since b5c7d567, including affected code paths and prior findings, at 5b2a9b529. Baseline: QA review.
No new actionable code findings.
No new actionable code findings in the follow-up. Before a reused account's claim is sent, tracking now fails the approval when that account is no longer active on this wallet, and the running node is asked to track the account even when the store already says it is tracked. When the node is not up, the existing deferral remains: the tracked flag stays in the store and startup reconciliation loads the account. A tracking failure still stops the claim. An in-sheet retry after a post-delivery failure stays pinned to that account. A failed new-account attempt still clears the chooser; that thread is resolved (Talos).
Closing the sheet and opening the same URL again can still share a different account after a delivered reuse. That thread is resolved and remains tracked in #2253. The three new account-choice strings stay English until #2250; that thread is resolved.
On bitkit-ios#1587 at c8fbfbc6, a reused account the store already marks tracked is sent without another node tracking call. This Android head asks the running node to track that account and fails the approval when the account is no longer active on this wallet. That comparison covers this tracking path only.
Ready for device testing. The follow-up does not change the account-choice screen. J1 Authorize is the step that now re-tracks an already stored account before the claim is sent.
Device testing: not performed in this review. The author reports just test and just lint on this commit; the choice screen was checked on 51f95a1. J1 Back, Cancel, and Authorize remain unrun. build-and-test and lint succeeded on this commit. Local end-to-end jobs were still running and are not evidence for this flow.
Reviewer model: grok-4.7
Reasoning effort: xhigh
Closes #2237
Twin: synonymdev/bitkit-ios#1587
Refs:
Description
Out of Scope
values-*/strings.xml: the three new strings stay English until the copy is final — chore: translate the server account choice strings #2250, raised in fix: offer existing server accounts on re-approval #2251 (comment)Design
N/A — no design available.
Preview
Re-approving a server whose account already exists, same-name account preselected:
android-choose-2x.mp4
QA Notes
Setup
marketplaceprofile, as injourneys/pubky-marketplace/README.md./pubky-marketplace setup-urloncesetup-url(a new secret)Journeys
reapprove-server-account.xml— re-approval offers the existing account preselected, reusing it keeps one account, "New account" adds oneManual Tests
N/A
Automated Checks
PubkyAuthApprovalViewModelTest.kt— choice shown with existing accounts, new account beside existing ones, reused account tracked after a post-delivery authorization failure, unfinished setup skips the choice, a failed new-account attempt drops the choice, a reused account is tracked before delivery and stays tracked on failure, a reused account that cannot be tracked is not sent, a post-delivery failure pins the retryWatchOnlyAccountRepoTest.kt— reuse shares the chosen account without a new index; an unfinished setup for the request is resumed instead; tracking a reused account adds it to the node, also when stored as tracked, and fails when it is no longer active on this walletEvidence
just test,just lintGaps
marketplaceprofile, which was not running for this runModels used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium)Gemini 4 Neon(reasoning:high)