Repository navigation
iOS: Simplify wallet detail screens - #83
Conversation
Use the activity status text for Phase and remove the internal reference and outpoint from payment details. Keep the Lightning outpoint copyable in Diagnostics and give it a specific label.
111ed32 to
9b7f67c
Compare
bhandras
left a comment
There was a problem hiding this comment.
Claude: READY at 9b7f67c80b5c19ee1e36f739c5af1f7cb4cc9c13
This verdict comes from reading the diff against the code traced at 111ed32. I did not run tests. Your reported run: 171 unit tests passed, 7 skipped, and both simulator UI fixture scenarios passed.
Fixed
| Previous finding | Status | How |
|---|---|---|
| Blocker: a released refresh turns back into "In progress" | Fixed | checkRefreshStatus now skips any operation where isResolved is true. A later spend or expiry of a released input can't reopen the old attempt. The test covers this: a second read still gives reads == 1, status stays "Partially refreshed", and networkSwitchBlockedReason == nil. |
| Follow-up: retry screen showed the whole wallet | Fixed | .review and .retry now both set funds = selectedFunds. Tracking keeps those funds, so the headline and expiry groups match the set that was submitted. |
Invariants checked
- Only the quoted selection can be submitted. The footer shows only when
preview.screen == screen. Start sendspreview.outpointsexactly. Before sending, the store checks the generation, a non-empty selection, and that any existing operation isnilorisResolved. - An ambiguous attempt can't be sent twice.
- While a submission is in flight, the operation is "Checking status" with
canRetry == nil, soisResolvedis false. - If the native call throws, the operation becomes "Action needed", also not resolved.
- In both cases
startRefreshrefuses any new selection until an observation resolves it.
- While a submission is in flight, the operation is "Checking status" with
- Released means final. Native sets
RetryAllowedonly when every input is confirmed or still live and no round is live. Nothing from that attempt can still settle, so dropping it from status checks is safe. The network-switch guard clears on the sameisResolvedcondition. - Each entry point opens the right screen.
- Settings and the home Recovery row: if the operation is resolved, they open a new review of all eligible funds, regardless of the old receipt.
- Activity (
showsRefreshReceipt): reopens.completeor.retry. - An unresolved operation always opens the tracking screen.
- Retry quotes only inputs that are still available.
- Released inputs are filtered against a fresh live/expired inventory before the preview.
- If none are left, there is no preview and the screen says "Nothing to refresh right now".
- If an input is spent between the inventory read and the preview, the preview fails and the user sees an error with "Try again". It does not show a wrong quote.
- The retry screen id stays stable.
remainingOutpointsno longer changes after release, so.task(id: screen)won't reload the screen on its own. - Stale loads after cancellation. Every state write after an
awaitstill checks cancellation, the screen and the network. Moving the inventory read before the preview adds no write that skips those checks.
No new findings.
|
/gateway review |
There was a problem hiding this comment.
Gateway review — 1 finding
🔴 0 Blocker · 🟠 0 Major · 🟡 1 Minor · 🔵 0 Nit
Summary
The PR moves RefreshWalletView into its own file. The new version is a state-driven screen: review, tracking, retry and complete. It adds expiry grouping with a pinned fee/Start footer and keeps the resolved receipt in Activity. A new RefreshOperation.isResolved predicate now drives the network-switch guard, the start-refresh admission check and the status-check short-circuit. The payment details screen drops the internal Reference and Outpoint rows and labels the diagnostics vhtlc_outpoint field.
The safety-relevant store changes hold up:
startRefreshchecks generation, a non-empty selection andisResolved != falseafterbeginStateCreatingCall. A second tap therefore can't send twice.- An ambiguous failure ("Action needed",
canRetry == nil) still blocks a new submission and blocks network switching. - In the view, every state write after an
awaitre-checks cancellation, the current screen and the network. - The retry path filters released inputs against a fresh live/expired inventory before quoting. A quote whose inputs don't match the inventory becomes an error instead of a wrong amount.
- The expiry bucketing math and sort order match the new test cases.
The one issue left is presentational: the Complete receipt's headline amount and expiry list come from the whole wallet, not from the refresh it describes.
Lower-severity findings (1)
🟡 F1 (Minor) — Complete receipt shows whole-wallet amount, not the refresh · ios/Sample/Sources/RefreshWalletView.swift:231
On .complete, load sets funds = available, meaning every live or expired VTXO. summary then shows groups.reduce(0) { $0 + $1.amountSat } as the headline next to "Refreshed". So the receipt opened from the Activity row (which shows refresh.amountSat) can show a much larger figure that includes funds received later or never submitted. During tracking, the headline was the submitted set. After confirmation it jumps to the wallet total. Show store.refreshOperation?.amountSat (or confirmedAmountSat) as the headline on .complete. Then label the expiry list as covering all spendable funds rather than implying it is this refresh's output.
Reviewed at medium effort.
Bot commands
/gateway re-review— re-run after pushing changes (maintainers)/gateway dismiss <id>— silence a finding (maintainers)/gateway explain <id>— elaborate on a finding (maintainers or PR author)
|
🤖 gateway audit metadata for this PR — auto-generated, please don't edit. |
Group the reviewed funds by estimated expiry and keep the fee and confirmation in a fixed footer. Show the refreshed inventory in place once the wallet confirms completion. Keep the refresh receipt until a new request starts. Preview a retry only for funds the wallet confirms are available again.
9b7f67c to
ca7a86b
Compare
|
/gateway re-review F1 is fixed in ca7a86b. The completed receipt shows the confirmed refresh amount, or the original submitted amount if needed. The updated list is labeled Wallet fund expiries because it includes the rest of the wallet. Please verify that the receipt headline can no longer include those unrelated funds and re-check the current head. |
There was a problem hiding this comment.
Gateway review
No findings.
Status of prior findings
- F1 addressed: Fixed at
ios/Sample/Sources/RefreshWalletView.swift:69-73. Whenscreen == .complete, the summary takes its headline fromoperation.confirmedAmountSat ?? operation.amountSatand never reaches thegroups.reducebranch. So the receipt figure is limited to the funds that were submitted or confirmed, and it matches therefresh.amountSatshown on the Activity row.expiryList(groups, showsWalletInventory: screen == .complete)at line 56 changes the heading to "Wallet fund expiries" (line 126), which says plainly that the list covers the whole wallet. Resolved.
Reviewed at medium effort.
Bot commands
/gateway re-review— re-run after pushing changes (maintainers)/gateway dismiss <id>— silence a finding (maintainers)/gateway explain <id>— elaborate on a finding (maintainers or PR author)
Payment details
Refresh
Testing
iOS simulator unit suite passed (171 passed, 7 skipped).
A local 20-group simulator fixture verified that the fee and action stay pinned while scrolling, progress is visible immediately after tapping, and confirmed expiry updates on the same screen.
A second simulator fixture verified that a retry is quoted only for funds still available after one of the released inputs was spent.