Repository navigation
Conversation
Verified: xcodebuild test unit selection from unit-tests.yml on an iPhone 17 simulator before the review fixes (4721 tests, 0 failures), PubkyAuthApprovalSheetTests after them (48 tests, 0 failures), swiftformat --lint on changed files, node scripts/validate-translations.js
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. |
Verified: none (changelog text only)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 510947876a
ℹ️ 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: 3/5
[High impact] The change reaches the Paykit server approval flow and can share an existing account with a server. Save the reused account's request ownership and tracking intent before merging. FindingsSummaryAdds a Bitcoin Account choice when approving a server request with existing active accounts.
Acknowledged scope from Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Approve receiving details] --> B{Unfinished setup?}
B -->|Yes| C[Resume saved account]
B -->|No active accounts| D[Create new account]
B -->|Active accounts exist| E[Choose account]
E -->|New account| D
E -->|Existing account| F[Deliver chosen xpub]
F --> G[Enable tracking]
C --> H[Authorize]
D --> H
G --> I{Authorization finished?}
I -->|Yes| J[Success]
I -->|No| K[Retry can choose another account]
Reviews (1) · Last reviewed commit: "fix: offer existing server accounts on r..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No new findings. Adds a Bitcoin Account step to server re-approval so an existing active server account can be shared again instead of reserving a new index. Reviewed 850d67bfd, full tier, static: iOS does not build on Linux, so this review is reasoned from the code and from CI.
What I checked, and 6 candidates I ruled out
Read in full: PubkyService.approveAuthRequest, WatchOnlyAccountManager (claim preparation, authorization attempt, setTrackingEnabled, requestFingerprint), PubkyAuthApprovalSheet state machine, onBack and performAuthorization, the new tests and reapprove-server-account.xml
Call sites traced: hasIncompleteSetup, reusableAccount, offersAccountChoice, didDeliverCompanionClaim
CI: SwiftFormat and validate green; Run Tests, Run Integration Tests and build-local still pending at the time of review
Ruled out
- Reused path skips
acquireSetupAuthorizationAttempt: it writes no setup state, and two concurrent reuses only call the idempotentsetTrackingEnabledunder the lifecycle lock, so the lock has nothing to protect there. - Stale choice after a failed new-account attempt:
cancelIncompleteAuthorizationleaves the record in.pendingDelivery, sohasIncompleteSetupis true and the sheet clearsexistingAccounts; the retry resumes that record. - Account from another wallet: the sheet filters by
currentWalletIndexandreusableAccountre-checks wallet and.activeunder the lock. - USDT combined claims:
unsignedPayload(account:usdtEndpoint:)takes the reused record the same way as a new one;requiresUsdtAddressis false whenever Bitcoin is shared, so the USDT toggle cannot strand the sheet in.chooseAccount. - Back navigation:
.authorizereturns to.chooseAccountonly while the choice is offered; after a failure clears it, Back goes to consent as before. - Already raised, not repeated: tracking not persisted before delivering a reused account, and a retry after a post-delivery failure sharing a different account (Greptile and Codex threads on
PubkyService.swift:240), still unaddressed at this head; localization is out of scope via #1585; the changelog fragment landed in850d67bfd.
Merge confidence: 3/5, the open P1 on keeping a delivered reused account tracked across a crash is real by trace (nothing persists tracking before companionApproval) and unaddressed at this head, and unit tests had not finished.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (runtime setting only, no per-review record)
Verified: PubkyAuthApprovalSheetTests on an iPhone 17 simulator (48 tests, 0 failures), swiftformat --lint on changed files
|
c8fbfbc also has the reuse path take the same single authorization attempt as a new account, so two approval sheets can no longer send claims at the same time. |
A reused account is checked and tracked in one step under the lifecycle lock, failing when it is no longer active on this wallet. The node is asked to track it even when the store already says tracked, since the node can lose it. Verified: xcodebuild test -only-testing:BitkitTests/PubkyAuthApprovalSheetTests -only-testing:BitkitTests/WatchOnlyAccountServiceTests, swiftformat --lint
A wallet switch while waiting for the lock could match a reused account against the previous wallet, so the wallet is read inside the lock. Verified: xcodebuild test -only-testing:BitkitTests/PubkyAuthApprovalSheetTests -only-testing:BitkitTests/WatchOnlyAccountServiceTests, swiftformat --lint
|
Pushed 12b0c53 and 6017e8e: a reused account is now tracked in one step under the account lock before its claim is sent, with the current wallet read inside the lock. The approval fails if the account is no longer active on this wallet (a restore, wipe or wallet switch meanwhile), and the node is asked to track it even when the store already says tracked, since the node can lose it. |
Twin: synonymdev/bitkit-android#2251
Source: qa, synonymdev/bitkit-android#2237
Refs:
Description
Out of Scope
Localizable.strings: the three new strings stay English until the copy is final — chore: translate the server account choice strings #1585, raised in fix: offer existing server accounts on re-approval #1587 (comment)Design
N/A — no design available.
Preview
Re-approving a server whose account already exists, same-name account preselected:
ios-choose-2x.mp4
QA Notes
Setup
marketplaceprofile, as injourneys/pubky-marketplace/README.md./pubky-marketplace setup-urloncebitkit://pubky-auth/setup?<query of the pubkyauth URL>; each run of the journey needs a freshsetup-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
PubkyAuthApprovalSheetTests.swift— choice offered when accounts exist, same-name preselection, reuse shares the chosen account and tracks it, inactive accounts rejected, reused account tracked before delivery and kept tracked after either failure, unfinished setup resumed instead of a chosen account, an already tracked account is tracked on the node againWatchOnlyAccountServiceTests.swift— tracking a reused account needs it active on this walletPubkyAuthApprovalSheetTestsandWatchOnlyAccountServiceTestson 6017e8eEvidence
Gaps
marketplaceprofile, which was not running for this run; unit tests cover the state each step leavesModels used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium)Gemini 4 Neon(reasoning:high)